• R/O
  • SSH

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisiona9e12042e2618e56ed24ce2f60c801058807a2b0 (tree)
Zeit2010-03-06 03:00:49
Autorlorenzo
Commiterlorenzo

Log Message

Some modifications to the code to analyze data and make the plots and also to the code which divides the interactions
into roles (the category ALL was also including categories which were anyway left out).

Ändern Zusammenfassung

Diff

diff -r fb267376c4a7 -r a9e12042e261 Python-codes/compartimentize_contacts.py
--- a/Python-codes/compartimentize_contacts.py Thu Mar 04 17:19:26 2010 +0000
+++ b/Python-codes/compartimentize_contacts.py Fri Mar 05 18:00:49 2010 +0000
@@ -75,7 +75,9 @@
7575 sel_P=s.where((tag_ids>=1400) & (tag_ids<1500))[0]
7676 sel_V=s.where((tag_ids>=1500) & (tag_ids<1600))[0]
7777 sel_A=s.where((tag_ids>=1600))[0]
78-sel_ALL=s.where((tag_ids>=0))[0]
78+#sel_ALL=s.where((tag_ids>=0))[0]
79+sel_ALL=s.where((tag_ids<1100) | ((tag_ids>=1200) & (tag_ids<1300)) | ((tag_ids>=1300) & (tag_ids<1400)) \
80+ | ((tag_ids>=1400) & (tag_ids<1500)) | ((tag_ids>=1600)) )[0]
7981
8082 sel_list=[sel_E,sel_F,sel_N,sel_D,sel_P,sel_V,sel_A,sel_ALL]
8183
diff -r fb267376c4a7 -r a9e12042e261 R-codes/ggplot-boxplot-synoptics.R
--- a/R-codes/ggplot-boxplot-synoptics.R Thu Mar 04 17:19:26 2010 +0000
+++ b/R-codes/ggplot-boxplot-synoptics.R Fri Mar 05 18:00:49 2010 +0000
@@ -254,6 +254,30 @@
254254
255255 if (plot_before_network==1){
256256
257+
258+file_loc <- c("../A-A/interactions_a_a_.dat",
259+ "../D-D/interactions_d_d_.dat",
260+ "../N-N/interactions_n_n_.dat",
261+ "../P-P/interactions_p_p_.dat",
262+ "../E-E/interactions_e_e_.dat")
263+
264+number_tags <- seq(length(file_loc))
265+
266+tag_categories <- c("A","D","N","P","E")
267+
268+
269+for (i in seq(length(file_loc))){
270+
271+#fn <- paste(prefix_vec[i],"Contact Number", sep=" ")
272+
273+tags_by_category <- read.table(file_loc[i])
274+
275+tags_by_category <- as.matrix(tags_by_category)
276+
277+number_tags[i] <- length(unique(c(tags_by_category[ ,2],tags_by_category[ ,3])))
278+
279+}
280+
257281 #This is useful and should get executed
258282
259283 if (hist_plot==1){
@@ -287,16 +311,24 @@
287311
288312 fn <- paste(prefix_vec[i],"Contact Number", sep=" ")
289313
290-my_dframe <- read.table(file_loc[i])
314+my_dframe <- read.table(file_loc[i], header=FALSE)
291315
292316 my_dframe <- as.matrix(my_dframe)
293317
318+if (i<=5){
319+
320+ print("dim(my_dframe)")
321+ print(dim(my_dframe))
322+
323+}
324+
294325
295326 #i.e. I am using 1 hours as a max duration of each (uncumulated!!!) link.
296327 sel <- which(my_dframe<=filter_unc)
297328
298329 my_dframe <- my_dframe[sel]
299330
331+
300332 ## print(max("my_dframe is "))
301333
302334 ## print(max(my_dframe))
@@ -308,9 +340,12 @@
308340 names(my_dframe) <- c("time")
309341 #my_dframe$time <- factor(my_dframe$time)
310342
311-list_ggplot[[i]] <- ggplot(my_dframe,aes(x=time,y=..count..) )+
312- geom_histogram(binwidth=.2, colour="black", fill="blue",origin=log10(20))+
313- # geom_vline(xintercept = 3600)+
343+list_ggplot[[i]] <- ggplot(my_dframe,aes(x=time) )+
344+ geom_histogram(aes(y=..count..), binwidth=.2, colour="black", fill="blue",origin=log10(20))+
345+ geom_vline(xintercept = log10(60), col="red", size=1)+
346+# geom_vline(xintercept = log10(600), col="black",size=1)+
347+ geom_vline(xintercept = log10(600), col="darkgreen",size=1)+
348+
314349 #xlab(theme_blank())+
315350 ylab(fn)+
316351 ## scale_x_continuous(trans="log10", limits=c(19,3600))+
@@ -498,6 +533,22 @@
498533
499534
500535
536+prefix_vec_double <- c("A","A","A","D","A","N","A","P","A","E",
537+ "D","D","D","N","D","P","D","E","N","N",
538+ "N","P","E","N","P","P","E","P","E","E")
539+
540+
541+
542+norm_vec <- seq(length(prefix_vec))
543+
544+
545+for (i in seq(length(prefix_vec))){
546+
547+norm_vec[i] <- number_tags[which(tag_categories==prefix_vec_double[2*i-1])]*number_tags[which(tag_categories==prefix_vec_double[2*i])]
548+
549+}
550+
551+
501552 sum_of_contact_durations <- seq(length(prefix_vec))
502553
503554 count_contacts <- seq(length(prefix_vec))
@@ -506,8 +557,8 @@
506557
507558 for (i in seq(15)){
508559
509-print("i is, ")
510-print(i)
560+## print("i is, ")
561+## print(i)
511562
512563 fn <- paste(prefix_vec[i],"Contact Number", sep=" ")
513564
@@ -552,9 +603,9 @@
552603 sum_of_contact_durations[i] <- sum(link_cumulative_durations)
553604 count_contacts[i] <- sum(number_contacts_in_link)
554605
555-if (prefix_vec[i]=="P-P"){
556-pp_durations <- link_cumulative_durations
557-}
606+## if (prefix_vec[i]=="P-P"){
607+## pp_durations <- link_cumulative_durations
608+## }
558609
559610
560611 #Now I get rid of links whose cumulated duration is excessive
@@ -564,11 +615,11 @@
564615
565616 my_dframe_tot <- cbind(link_cumulative_durations,number_contacts_in_link)
566617
567-print("max(my_dframe_tot[ ,1])")
568-print(max(my_dframe_tot[ ,1]))
618+## print("max(my_dframe_tot[ ,1])")
619+## print(max(my_dframe_tot[ ,1]))
569620
570-print("max(my_dframe_tot[ ,2])")
571-print(max(my_dframe_tot[ ,2]))
621+## print("max(my_dframe_tot[ ,2])")
622+## print(max(my_dframe_tot[ ,2]))
572623
573624
574625 my_dframe_tot <- as.data.frame(my_dframe_tot)
@@ -671,7 +722,8 @@
671722 x_mid <- (x_max+x_min)/2
672723
673724 y_min <- rep(0,length(prefix_vec))
674-y_max <- sum_of_contact_durations/sum(sum_of_contact_durations)
725+#y_max <- sum_of_contact_durations/sum(sum_of_contact_durations)
726+y_max <- sum_of_contact_durations
675727
676728 data_small <- cbind(y_max,y_min,x_min,x_max,x_mid)
677729
@@ -684,14 +736,14 @@
684736 my_ybreaks <- (seq(8)-1)/10
685737
686738 count_duration_plot<- ggplot(data_new)+
687- geom_rect(aes(ymin = y_min, ymax = y_max,xmin=x_min,xmax=x_max), colour="black", fill="blue")+
739+ geom_rect(aes(ymin = y_min, ymax= y_max/3600.,xmin=x_min,xmax=x_max), colour="black", fill="blue")+
688740 xlab("Role Pair")+
689- ylab("Fraction of Overall Contact Duration")+
741+ ylab("Total Contact Duration [hours]")+
690742 ## scale_x_continuous(trans="log10", limits=c(19,660))+
691743 ## scale_y_continuous(trans="log10", limits=c(1,700))+
692744 ## scale_x_continuous(trans="log10",limits=c(20,18000))+
693745 scale_x_continuous(labels=prefix_vec, breaks=x_mid)+
694-scale_y_continuous( limits=c(0.,0.7), breaks=my_ybreaks)+
746+#scale_y_continuous( limits=c(0.,0.7), breaks=my_ybreaks)+
695747 opts(axis.title.x = theme_text(size = 35))+
696748 opts(axis.title.y = theme_text(size = 35, angle=90))+
697749 opts(axis.text.x = theme_text(size=30, colour="black",vjust=1))+
@@ -700,27 +752,27 @@
700752 opts(axis.text.y = theme_text(size=30, colour="black", hjust=1))
701753
702754
703-CairoPDF("Contact_duration_fraction_per_coupled_roles_rectangles.pdf", width=20, height=10)
755+CairoPDF("Contact_duration_per_coupled_roles.pdf", width=20, height=10)
704756
705757 print(count_duration_plot)
706758 dev.off()
707759
708760
709-#Now
710-
711-data_new$y_max <- count_contacts/sum(count_contacts)
712761
713-my_ybreaks <- (seq(5)-1)/10
714762
715-count_contact_plot<- ggplot(data_new)+
716- geom_rect(aes(ymin = y_min, ymax = y_max,xmin=x_min,xmax=x_max), colour="black", fill="blue")+
763+#and its normalized version
764+
765+my_ybreaks <- seq(0,20,by=5)
766+
767+count_duration_plot<- ggplot(data_new)+
768+ geom_rect(aes(ymin = y_min, ymax = y_max/norm_vec/60.,xmin=x_min,xmax=x_max), colour="black", fill="blue")+
717769 xlab("Role Pair")+
718- ylab("Fraction of Overall Contact Number")+
770+ ylab("Normalized Total Contact Duration [min]")+
719771 ## scale_x_continuous(trans="log10", limits=c(19,660))+
720772 ## scale_y_continuous(trans="log10", limits=c(1,700))+
721773 ## scale_x_continuous(trans="log10",limits=c(20,18000))+
722774 scale_x_continuous(labels=prefix_vec, breaks=x_mid)+
723-scale_y_continuous( limits=c(0.0,0.4), breaks=my_ybreaks)+
775+scale_y_continuous( limits=c(0.,20.), breaks=my_ybreaks)+
724776 opts(axis.title.x = theme_text(size = 35))+
725777 opts(axis.title.y = theme_text(size = 35, angle=90))+
726778 opts(axis.text.x = theme_text(size=30, colour="black",vjust=1))+
@@ -729,11 +781,78 @@
729781 opts(axis.text.y = theme_text(size=30, colour="black", hjust=1))
730782
731783
732-CairoPDF("Contact_number_fraction_per_coupled_roles_rectangles.pdf", width=20, height=10)
784+CairoPDF("Normalized_contact_duration_per_coupled_roles.pdf", width=20, height=10)
785+
786+print(count_duration_plot)
787+dev.off()
788+
789+
790+
791+
792+
793+#Now the fraction of contacts
794+
795+#data_new$y_max <- count_contacts/sum(count_contacts)
796+
797+data_new$y_max <- count_contacts
798+
799+
800+my_ybreaks <- (seq(5)-1)/10
801+
802+count_contact_plot<- ggplot(data_new)+
803+ geom_rect(aes(ymin = y_min, ymax = y_max,xmin=x_min,xmax=x_max), colour="black", fill="blue")+
804+ xlab("Role Pair")+
805+ ylab("Total Contact Number")+
806+## scale_x_continuous(trans="log10", limits=c(19,660))+
807+## scale_y_continuous(trans="log10", limits=c(1,700))+
808+ ## scale_x_continuous(trans="log10",limits=c(20,18000))+
809+ scale_x_continuous(labels=prefix_vec, breaks=x_mid)+
810+#scale_y_continuous( limits=c(0.0,0.4), breaks=my_ybreaks)+
811+ opts(axis.title.x = theme_text(size = 35))+
812+ opts(axis.title.y = theme_text(size = 35, angle=90))+
813+ opts(axis.text.x = theme_text(size=30, colour="black",vjust=1))+
814+ # opts(axis.text.x = theme_blank())+
815+# geom_text(aes(label = labels, fill = NULL), data = data_new)+
816+ opts(axis.text.y = theme_text(size=30, colour="black", hjust=1))
817+
818+
819+CairoPDF("Contact_number_per_coupled_roles.pdf", width=20, height=10)
733820
734821 print(count_contact_plot)
735822 dev.off()
736823
824+
825+#and its normalized version
826+
827+my_ybreaks <- c(0,0.5e-3,1e-3,1.5e-3,2e-3)
828+
829+count_contact_plot<- ggplot(data_new)+
830+ geom_rect(aes(ymin = y_min, ymax = y_max/norm_vec,xmin=x_min,xmax=x_max), colour="black", fill="blue")+
831+ xlab("Role Pair")+
832+ ylab("Normalized Total Contact Number")+
833+## scale_x_continuous(trans="log10", limits=c(19,660))+
834+## scale_y_continuous(trans="log10", limits=c(1,700))+
835+ ## scale_x_continuous(trans="log10",limits=c(20,18000))+
836+ scale_x_continuous(labels=prefix_vec, breaks=x_mid)+
837+#scale_y_continuous( limits=c(0.0,2e-3), breaks=my_ybreaks)+
838+ opts(axis.title.x = theme_text(size = 35))+
839+ opts(axis.title.y = theme_text(size = 35, angle=90))+
840+ opts(axis.text.x = theme_text(size=30, colour="black",vjust=1))+
841+ # opts(axis.text.x = theme_blank())+
842+# geom_text(aes(label = labels, fill = NULL), data = data_new)+
843+ opts(axis.text.y = theme_text(size=30, colour="black", hjust=1))
844+
845+
846+CairoPDF("Normalized_contact_number_per_coupled_roles.pdf", width=20, height=10)
847+
848+print(count_contact_plot)
849+dev.off()
850+
851+
852+
853+
854+
855+
737856 ##########################################################################################################à
738857 ##########################################################################################################à
739858 ##########################################################################################################à
@@ -777,8 +896,8 @@
777896
778897 for (i in seq(length(prefix_vec))){
779898
780-print("i is, ")
781-print(i)
899+## print("i is, ")
900+## print(i)
782901
783902 #fn <- paste(prefix_vec[i]," Number of Contacts", sep=" ")
784903
@@ -867,7 +986,8 @@
867986 x_mid <- (x_max+x_min)/2
868987
869988 y_min <- rep(0,length(prefix_vec))
870-y_max <- sum_of_contact_durations/sum(sum_of_contact_durations)
989+#y_max <- sum_of_contact_durations/sum(sum_of_contact_durations)
990+y_max <- sum_of_contact_durations
871991
872992 data_small <- cbind(y_max,y_min,x_min,x_max,x_mid)
873993
@@ -877,17 +997,17 @@
877997
878998 names(data_new) <- c("y_max","y_min","x_min","x_max","x_mid","my_labels")
879999
880-my_ybreaks <- (seq(5)-1)/10
1000+my_ybreaks <- seq(0,200,by=50)
8811001
8821002 count_duration_plot<- ggplot(data_new)+
883- geom_rect(aes(ymin = y_min, ymax = y_max,xmin=x_min,xmax=x_max), colour="black", fill="blue")+
1003+ geom_rect(aes(ymin = y_min, ymax = y_max/3600.,xmin=x_min,xmax=x_max), colour="black", fill="blue")+
8841004 xlab("Role")+
885- ylab("Fraction of Overall Contact Duration")+
1005+ ylab("Total Contact Duration [hours]")+
8861006 ## scale_x_continuous(trans="log10", limits=c(19,660))+
8871007 ## scale_y_continuous(trans="log10", limits=c(1,700))+
8881008 ## scale_x_continuous(trans="log10",limits=c(20,18000))+
8891009 scale_x_continuous(labels=prefix_vec, breaks=x_mid)+
890-scale_y_continuous( limits=c(0.0,0.4), breaks=my_ybreaks)+
1010+scale_y_continuous( limits=c(0.0,200), breaks=my_ybreaks)+
8911011 opts(axis.title.x = theme_text(size = 20))+
8921012 opts(axis.title.y = theme_text(size = 20, angle=90))+
8931013 opts(axis.text.x = theme_text(size=15, colour="black",vjust=1))+
@@ -896,27 +1016,25 @@
8961016 opts(axis.text.y = theme_text(size=15, colour="black", hjust=1))
8971017
8981018
899-CairoPDF("Contact_duration_fraction_per_role_rectangles.pdf")
1019+CairoPDF("Contact_duration_per_role.pdf")
9001020
9011021 print(count_duration_plot)
9021022 dev.off()
9031023
9041024
905-#Now
906-
907-data_new$y_max <- count_contacts/sum(count_contacts)
1025+#Now its normalized version
9081026
909-my_ybreaks <- (seq(4)-1)/10
1027+#my_ybreaks <- seq(0,200,by=50)
9101028
911-count_contact_plot<- ggplot(data_new)+
912- geom_rect(aes(ymin = y_min, ymax = y_max,xmin=x_min,xmax=x_max), colour="black", fill="blue")+
1029+count_duration_plot<- ggplot(data_new)+
1030+ geom_rect(aes(ymin = y_min, ymax = y_max/number_tags/60.,xmin=x_min,xmax=x_max), colour="black", fill="blue")+
9131031 xlab("Role")+
914- ylab("Fraction of Overall Contact Number")+
1032+ ylab("Normalized Total Contact Duration [min]")+
9151033 ## scale_x_continuous(trans="log10", limits=c(19,660))+
9161034 ## scale_y_continuous(trans="log10", limits=c(1,700))+
9171035 ## scale_x_continuous(trans="log10",limits=c(20,18000))+
9181036 scale_x_continuous(labels=prefix_vec, breaks=x_mid)+
919-scale_y_continuous( limits=c(0.0,0.3), breaks=my_ybreaks)+
1037+#scale_y_continuous( limits=c(0.0,20), breaks=my_ybreaks)+
9201038 opts(axis.title.x = theme_text(size = 20))+
9211039 opts(axis.title.y = theme_text(size = 20, angle=90))+
9221040 opts(axis.text.x = theme_text(size=15, colour="black",vjust=1))+
@@ -925,11 +1043,71 @@
9251043 opts(axis.text.y = theme_text(size=15, colour="black", hjust=1))
9261044
9271045
928-CairoPDF("Contact_number_fraction_per_role_rectangles.pdf")
1046+CairoPDF("Normalized_contact_duration_per_role.pdf")
1047+
1048+print(count_duration_plot)
1049+dev.off()
1050+
1051+
1052+
1053+#####################################################################
1054+
1055+#Now the same quantity with contact numbers
1056+
1057+#data_new$y_max <- count_contacts/sum(count_contacts)
1058+data_new$y_max <- count_contacts
1059+
1060+my_ybreaks <- (seq(4)-1)/10
1061+
1062+count_contact_plot<- ggplot(data_new)+
1063+ geom_rect(aes(ymin = y_min, ymax = y_max,xmin=x_min,xmax=x_max), colour="black", fill="blue")+
1064+ xlab("Role")+
1065+ ylab("Total Contact Number")+
1066+## scale_x_continuous(trans="log10", limits=c(19,660))+
1067+## scale_y_continuous(trans="log10", limits=c(1,700))+
1068+ ## scale_x_continuous(trans="log10",limits=c(20,18000))+
1069+ scale_x_continuous(labels=prefix_vec, breaks=x_mid)+
1070+#scale_y_continuous( limits=c(0.0,0.3), breaks=my_ybreaks)+
1071+ opts(axis.title.x = theme_text(size = 20))+
1072+ opts(axis.title.y = theme_text(size = 20, angle=90))+
1073+ opts(axis.text.x = theme_text(size=15, colour="black",vjust=1))+
1074+ # opts(axis.text.x = theme_blank())+
1075+# geom_text(aes(label = labels, fill = NULL), data = data_new)+
1076+ opts(axis.text.y = theme_text(size=15, colour="black", hjust=1))
1077+
1078+
1079+CairoPDF("Contact_number_per_role.pdf")
9291080
9301081 print(count_contact_plot)
9311082 dev.off()
9321083
1084+
1085+my_ybreaks <- c(0,0.5e-2,1e-2,1.5e-2,2e-2)
1086+
1087+count_contact_plot<- ggplot(data_new)+
1088+ geom_rect(aes(ymin = y_min, ymax = y_max/number_tags,xmin=x_min,xmax=x_max), colour="black", fill="blue")+
1089+ xlab("Role")+
1090+ ylab("Normalized Total Contact Number")+
1091+## scale_x_continuous(trans="log10", limits=c(19,660))+
1092+## scale_y_continuous(trans="log10", limits=c(1,700))+
1093+ ## scale_x_continuous(trans="log10",limits=c(20,18000))+
1094+ scale_x_continuous(labels=prefix_vec, breaks=x_mid)+
1095+#scale_y_continuous( limits=c(0.0,0.02), breaks=my_ybreaks)+
1096+ opts(axis.title.x = theme_text(size = 20))+
1097+ opts(axis.title.y = theme_text(size = 20, angle=90))+
1098+ opts(axis.text.x = theme_text(size=15, colour="black",vjust=1))+
1099+ # opts(axis.text.x = theme_blank())+
1100+# geom_text(aes(label = labels, fill = NULL), data = data_new)+
1101+ opts(axis.text.y = theme_text(size=15, colour="black", hjust=1))
1102+
1103+
1104+CairoPDF("Normalized_contact_number_per_role.pdf")
1105+
1106+print(count_contact_plot)
1107+dev.off()
1108+
1109+
1110+
9331111 print("OK down here")
9341112
9351113 #Now I go on with a boxplot
@@ -942,11 +1120,24 @@
9421120 data_bp$role_label <- factor(data_bp$role_label)
9431121
9441122
1123+line_seq <- c(log10(300),log10(600),log10(1800))
1124+line_col <- c("5 minutes", "10 minutes", "30 minutes")
1125+
1126+data_line <- cbind(as.data.frame(line_seq),as.data.frame(line_col))
1127+
1128+names(data_line) <- c("line_seq","line_col")
9451129
9461130 my_ybreaks <- c(1e1,1e2,1e3,1e4)
9471131 gpl <- ggplot(data_bp,aes(x=role_label,y=contact_data) )+
9481132 # geom_boxplot( quantiles = c(0,1))+
9491133 geom_boxplot( )+
1134+ geom_hline(yintercept = log10(300), col="red", size=1)+
1135+ geom_hline(yintercept = log10(600), col="black",size=1)+
1136+ geom_hline(yintercept = log10(1800), col="darkgreen",size=1)+
1137+
1138+#geom_hline(yintercept = line_seq, col="red", size=1)+
1139+#geom_hline(data=dataline, yintercept = line_seq, color=line_col, size=1)+
1140+
9501141 ## scale_x_log10() +
9511142 ## scale_y_log10()+ #better NOT to use short-hand notation if you want to set the axis
9521143 #scale_x_continuous(trans = "log10", limits=c(10,1e4))+
@@ -1016,8 +1207,8 @@
10161207
10171208 gt95 <- c(gt95,as.matrix(data_bp$contact_data[sel][sel2]))
10181209
1019-print ("length(gt95 is, )")
1020-print(length(gt95))
1210+## print ("length(gt95 is, )")
1211+## print(length(gt95))
10211212
10221213 gt95_lab <- c(gt95_lab,as.vector(data_bp$role_label[sel][sel2]))
10231214
@@ -1045,6 +1236,10 @@
10451236 geom_crossbar(aes(y = q50, ymin = q25, ymax = q75),fill="white") +
10461237 geom_crossbar(aes(y = q95, ymin = q95, ymax = q95)) +
10471238 geom_crossbar(aes(y = q5, ymin = q5, ymax = q5)) +
1239+ geom_hline(yintercept = log10(300), col="red", size=1)+
1240+ geom_hline(yintercept = log10(600), col="black",size=1)+
1241+ geom_hline(yintercept = log10(1800), col="darkgreen",size=1)+
1242+
10481243 scale_y_continuous( trans="log10", limits=c(1e1,1e4), breaks=my_ybreaks)+
10491244
10501245 geom_errorbar(limits) +
@@ -1091,8 +1286,9 @@
10911286
10921287 if (plot_network==1){
10931288
1289+
10941290 list_ggplot <- list() #I re-initialize this list
1095-
1291+#list_g_con <- list() #this list will contain the connected nodes in the network
10961292
10971293 ## file_loc <- c("../A-A/interactions_a_a_.dat",
10981294 ## "../A-D/interactions_a_d_.dat",
@@ -1185,6 +1381,24 @@
11851381
11861382
11871383
1384+file_loc4 <- c("../A-A/hashed_couples_in_contact_durations_1_.dat",
1385+ "../A-D/hashed_couples_in_contact_durations_1_.dat",
1386+ "../A-N/hashed_couples_in_contact_durations_1_.dat",
1387+ "../A-P/hashed_couples_in_contact_durations_1_.dat",
1388+ "../A-E/hashed_couples_in_contact_durations_1_.dat",
1389+ "../D-D/hashed_couples_in_contact_durations_1_.dat",
1390+ "../D-N/hashed_couples_in_contact_durations_1_.dat",
1391+ "../D-P/hashed_couples_in_contact_durations_1_.dat",
1392+ "../D-E/hashed_couples_in_contact_durations_1_.dat",
1393+ "../N-N/hashed_couples_in_contact_durations_1_.dat",
1394+ "../N-P/hashed_couples_in_contact_durations_1_.dat",
1395+ "../E-N/hashed_couples_in_contact_durations_1_.dat",
1396+ "../P-P/hashed_couples_in_contact_durations_1_.dat",
1397+ "../E-P/hashed_couples_in_contact_durations_1_.dat",
1398+ "../E-E/hashed_couples_in_contact_durations_1_.dat")
1399+
1400+
1401+
11881402
11891403 prefix_vec <- c("A-A","A-D","A-N","A-P","A-E",
11901404 "D-D","D-N","D-P","D-E","N-N",
@@ -1206,8 +1420,8 @@
12061420 #for (i in sel_num){
12071421
12081422
1209-print("i is, ")
1210-print(i)
1423+## print("i is, ")
1424+## print(i)
12111425
12121426
12131427 duration_list <- read.table(file_loc2[i],header=FALSE)
@@ -1227,13 +1441,19 @@
12271441 tab_ini <- read.table(file_loc[i],header=FALSE)
12281442 tab_ini <- as.matrix(tab_ini)
12291443
1444+hashed_ids <- read.table(file_loc4[i],header=FALSE)
1445+hashed_ids <- as.matrix(hashed_ids)
1446+
12301447
12311448 #Now get rid of all the contacts below a certain threhshold
12321449
12331450 tab_ini <- tab_ini[sel,]
12341451 duration_list <- duration_list[sel]
12351452
1453+# and also update the duration list!
1454+duration_list <- duration_list[sel]
12361455
1456+hashed_ids <- hashed_ids[sel]
12371457
12381458 ## graph_raw_no_time <- tab_ini[ , 2:dim(tab_ini)[2]]
12391459
@@ -1258,11 +1478,18 @@
12581478 # 99878976 1234558
12591479 #which are obviously the same edge repeated twice.
12601480
1481+#E(g)$weight <- duration_list
1482+
1483+#wb <- duration_list
12611484
12621485 g <- simplify(g)
12631486
1487+#wa <- E(g)$weight
1488+
12641489 names_g <- V(g)$name
12651490
1491+hashed_unique <- unique(hashed_ids)
1492+
12661493
12671494 #E(g)$weight <- duration_list
12681495
@@ -1272,12 +1499,12 @@
12721499 ids_isolated_nodes <- setdiff(tag_list,ids_connected_nodes)
12731500
12741501
1275-print("ids_isolated_nodes")
1502+## print("ids_isolated_nodes")
12761503
1277-print(ids_isolated_nodes)
1504+## print(ids_isolated_nodes)
12781505
1279-print("number isol nodes")
1280-print(length(ids_isolated_nodes))
1506+## print("number isol nodes")
1507+## print(length(ids_isolated_nodes))
12811508
12821509 #Now add the isolated nodes to the graph
12831510
@@ -1380,4 +1607,8 @@
13801607 dev.off()
13811608
13821609 }
1610+
1611+
1612+
1613+
13831614 print("So far so good")