diff --git a/src/VIVA.jl b/src/VIVA.jl index a541256..49f73c9 100644 --- a/src/VIVA.jl +++ b/src/VIVA.jl @@ -17,13 +17,6 @@ using Test #end #module -#= -const g_white = "400" #homo reference 0/0 -const g_red = "800" #homo variant 1/1 1/2 2/2 1/3 2/3 3/3 4/4 5/5 6/6 etc -const g_pink = "600" #hetero variant 0/1 1/0 0/2 2/0 etc -const g_blue = "0" #no call ./. -=# - export format_reader, load_vcf, @@ -80,8 +73,7 @@ export add_pheno_matrix_to_dp_data_for_plotting, generate_hover_text_array, generate_hover_text_array_grouped, - save_graphic, - alias + save_graphic #include("vcf_utils.jl") include("vcf_utils_complete.jl") diff --git a/src/vcf_utils_complete.jl b/src/vcf_utils_complete.jl index a46ac52..1f9f6b0 100644 --- a/src/vcf_utils_complete.jl +++ b/src/vcf_utils_complete.jl @@ -17,7 +17,7 @@ end """ clean_column1_siglist!(siglist) - replaces "X","Y","M" with 23,24,25 {Int} +Replaces strings "X","Y","M" with 23,24,25 {Int} in array generated in load_siglist() use in load_siglist() because X and Y need to be replaced with Int """ function clean_column1_siglist!(siglist) @@ -1476,13 +1476,15 @@ return(hover_text_array) end """ - save_graphic(graphic,output_directory,save_ext,title) + save_graphic(graphic,output_directory,save_ext,title,remote_option) Save plot in either html or static image formats incuding eps, png, svg, and pdf """ -function save_graphic(graphic,output_directory,save_ext,title) +function save_graphic(graphic,output_directory,save_ext,title,remote_option) - if save_ext=="html" + if save_ext=="html" && remote_option == true PlotlyJS.savehtml(graphic, joinpath("$(output_directory)" ,"$title.$(save_ext)"), :remote) + elseif save_ext=="html" && remote_option != true + PlotlyJS.savehtml(graphic, joinpath("$(output_directory)" ,"$title.$(save_ext)")) elseif save_ext != "html" PlotlyJS.savefig(graphic, joinpath("$(output_directory)" ,"$title.$(save_ext)")) end diff --git a/test/.DS_Store b/test/.DS_Store index 058d747..81c6827 100644 Binary files a/test/.DS_Store and b/test/.DS_Store differ diff --git a/test/new_vcf_utils.jl b/test/new_vcf_utils.jl index 5a7b51a..95f773c 100644 --- a/test/new_vcf_utils.jl +++ b/test/new_vcf_utils.jl @@ -12,10 +12,10 @@ julia> Pkg.test(pkg_for"VIVA") @testset "VCFUtils" begin vcf_filename = "test_files/test_4X_191.vcf" -vcf_filename_with_chr = "test_files/test_with_chr.vcf" +#vcf_filename_with_chr = "test_files/test_with_chr.vcf" reader = VCF.Reader(open(vcf_filename, "r")) -reader_with_chr = VCF.Reader(open(vcf_filename_with_chr, "r")) +#reader_with_chr = VCF.Reader(open(vcf_filename_with_chr, "r")) sample_names = get_sample_names(reader) dp_limit = 50 @@ -30,23 +30,23 @@ end #functions for variant filters -@testset "io_chromosome_range_vcf_filter" begin -sub = io_chromosome_range_vcf_filter("chr4:0-400000000",vcf_filename) +@testset "io_genomic_range_vcf_filter" begin +sub = io_genomic_range_vcf_filter("chr4:0-400000000",vcf_filename) @test typeof(sub) == Array{Any,1} @test size(sub,1) == 1012 -#println("io_chromosome_range_vcf_filter type is $(typeof(sub))") -#println("io_chromosome_range_vcf_filter size is $(size(sub,1))") +#println("io_genomic_range_vcf_filter type is $(typeof(sub))") +#println("io_genomic_range_vcf_filter size is $(size(sub,1))") end @testset "filters_with_siglist" begin @testset "load_siglist" begin - sig_list=load_siglist("test_files/sig_list_for_test.csv") + sig_list=load_siglist("test_files/positions_list.csv") - @testset "pass_chrrange_siglist_filter" begin - sig_list=load_siglist("test_files/sig_list_for_test.csv") - sub = pass_chrrange_siglist_filter(vcf_filename,sig_list,"chr4:0-5000000000") + @testset "pass_genomic_range_siglist_filter" begin + sig_list=load_siglist("test_files/positions_list.csv") + sub = pass_genomic_range_siglist_filter(vcf_filename,sig_list,"chr4:0-5000000000") @test (typeof(sub[1])) == GeneticVariation.VCF.Record @test (length(sub)) == 5 @@ -66,8 +66,8 @@ end @test (length(sub)) == 10 end - @testset "chrrange_siglist_filter" begin - sub = chrrange_siglist_filter(vcf_filename,sig_list,"chr4:0-400000000") + @testset "genomic_range_siglist_filter" begin + sub = genomic_range_siglist_filter(vcf_filename,sig_list,"chr4:0-400000000") @test (typeof(sub[1])) == GeneticVariation.VCF.Record @test (length(sub)) == 5 end @@ -82,9 +82,9 @@ end @test (length(sub)) == 1164 end -@testset "pass_chrrange_filter" begin +@testset "pass_genomic_range_filter" begin reader = VCF.Reader(open(vcf_filename, "r")) - sub = pass_chrrange_filter(reader,"chr4:0-400000000",vcf_filename) + sub = pass_genomic_range_filter(reader,"chr4:0-400000000",vcf_filename) @test (typeof(sub[1])) == GeneticVariation.VCF.Record @test (length(sub)) == 856 end @@ -220,7 +220,7 @@ dp_num_array,dp_chromosome_labels=combined_all_read_depth_array_functions(sub) end @testset "sortcols_by_phenotype_matrix" begin - vcf,group_label_pack=sortcols_by_phenotype_matrix("test_files/fixed_pheno_matrix_test.csv","case,control", dp_num_array, sample_names) + vcf,group_label_pack=sortcols_by_phenotype_matrix("test_files/sample_metadata_matrix.csv","case,control", dp_num_array, sample_names) #println("sortcols_by_phenotype_matrix vcf type is $(typeof(vcf))") #println("sortcols_by_phenotype_matrix vcf size is $(size(vcf,1))") #println("sortcols_by_phenotype_matrix group_label_pack type is $(typeof(group_label_pack))") diff --git a/test/test_files/test_with_chr.vcf b/test/test_files/chr_format.vcf similarity index 100% rename from test/test_files/test_with_chr.vcf rename to test/test_files/chr_format.vcf diff --git a/test/test_files/pheno_matrix_chr.csv b/test/test_files/pheno_matrix_chr.csv deleted file mode 100644 index 61124fa..0000000 --- a/test/test_files/pheno_matrix_chr.csv +++ /dev/null @@ -1,2 +0,0 @@ -id,WESPE2004,WESPE2006,WESPE2008,WESPE2037,WESPE2056,WESPE2058,WESPE2066,WESPE2105,WESPE2115,WESPE2120,WESPE2159,WESPE2161,WESPE2201,WESPE2253,WESPE2260,WESPE2287,WESPE2295,WESPE2310,WESPE2311,WESPE2314,WESPE2324,WESPE2333,WESPE2362,WESPE2370,WESPE2385,WESPE2388,WESPE2390,WESPE2415,WESPE2418,WESPE2437,WESPE2480,WESPE2486,WESPE2496,WESPE2523,WESPE2530,WESPE2531,WESPE2545,WESPE2555,WESPE2579,WESPE2621,WESPE2633,WESPE2705,WESPE2757,WESPE2782,WESPE2829,WESPE2844,WESPE2851,WESPE2876,WESPE2925,WESPE2932,wespe2007,wespe2020,wespe2023,wespe2051,wespe2074,wespe2079,wespe2084,wespe2141,wespe2182,wespe2185,wespe2233,wespe2234,wespe2257,wespe2291,wespe2307,wespe2325,wespe2334,wespe2346,wespe2354,wespe2358,wespe2366,wespe2407,wespe2432,wespe2440,wespe2463,wespe2482,wespe2483,wespe2488,wespe2518,wespe2525,wespe2543,wespe2567,wespe2602,wespe2611,wespe2638,wespe2645,wespe2662,wespe2670,wespe2727,wespe2744,wespe2776,wespe2812,wespe2840,wespe2877,wespe2889,wespe2896,wespe2908,wespe2912,wespe2946,wespe2980 -"test1,test2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 \ No newline at end of file diff --git a/test/test_files/sig_list_for_test.csv b/test/test_files/positions_list.csv similarity index 100% rename from test/test_files/sig_list_for_test.csv rename to test/test_files/positions_list.csv diff --git a/test/test_files/positions_list_test_4X_191.csv b/test/test_files/positions_list_test_4X_191.csv deleted file mode 100644 index 9541902..0000000 --- a/test/test_files/positions_list_test_4X_191.csv +++ /dev/null @@ -1,16 +0,0 @@ -Chr,Start -4,3162034 -4,3162056 -4,3162170 -X,46460089 -X,46460615 -X,46460899 -X,46461449 -X,46461486 -X,46461536 -X,46462031 -X,46462132 -4,3076380 -4,3076381 -4,3076384 -4,3076390 \ No newline at end of file diff --git a/test/test_files/fixed_pheno_matrix_test.csv b/test/test_files/sample_metadata_matrix.csv similarity index 100% rename from test/test_files/fixed_pheno_matrix_test.csv rename to test/test_files/sample_metadata_matrix.csv diff --git a/test/test_files/sample_order_list_fortest.txt b/test/test_files/sample_order_list_fortest.txt deleted file mode 100644 index b0281c2..0000000 --- a/test/test_files/sample_order_list_fortest.txt +++ /dev/null @@ -1 +0,0 @@ -_CHROM POS ID REF ALT QUAL FILTER INFO FORMAT addrg_dedup_Lib2_16.bam addrg_dedup_Lib2_2.bam addrg_dedup_Lib2_4.bam addrg_dedup_Lib2_7.bam addrg_dedup_Lib1_12.bam addrg_dedup_Lib1_19.bam addrg_dedup_Lib1_5.bam addrg_dedup_Lib1_6.bam addrg_dedup_Lib3_13.bam addrg_dedup_Lib3_14.bam addrg_dedup_Lib3_15.bam addrg_dedup_Lib3_18.bam addrg_dedup_Lib4_1.bam addrg_dedup_Lib4_10.bam addrg_dedup_Lib4_11.bam addrg_dedup_Lib4_8.bam addrg_dedup_Lib5_22.bam addrg_dedup_Lib5_27.bam addrg_dedup_Lib5_3.bam addrg_dedup_Lib5_9.bam addrg_dedup_Lib6_20.bam addrg_dedup_Lib6_21.bam addrg_dedup_Lib6_23.bam addrg_dedup_Lib6_25.bam \ No newline at end of file diff --git a/test/test_files/sample_phenotype_matrix.csv b/test/test_files/sample_phenotype_matrix.csv deleted file mode 100644 index 0763bab..0000000 --- a/test/test_files/sample_phenotype_matrix.csv +++ /dev/null @@ -1,4 +0,0 @@ -id,MODcas1001,MODcas1003,MODcas1005,MODcas1010,MODcas1012,MODcas1013,MODcas1014,MODcas1015,MODcas1017,MODcas1018,MODcas1019,MODcas1020,MODcas1021,MODcas1022,MODcas1023,MODcas1024,MODcas2025,MODcas2027,MODcas2028,MODcas2029,MODcas2032,MODcas2033,MODcas2034,MODcas2035,MODcas2038,MODcas2039,MODcas2040,MODcas2041,MODcas2043,MODcas2044,MODcas2045,MODcas2048,MODcas3050,MODcas3051,MODcas3052,MODcas3053,MODcas3054,MODcas3055,MODcas3056,MODcas3057,MODcas3058,MODcas3059,MODcas3060,MODcas3061,MODcas3062,MODcas3065,MODcas3072,MODcas3073,MODcas3074,MODcas3075,MODcas3076,MODcas3077,MODcas3078,MODcas3079,MODcas3080,MODcas3081,MODcas3082,MODcas3083,MODcas3084,MODcas3085,MODcas3086,MODcas3089,MODcas3092,MODcas3096,MODcon1002,MODcon1004,MODcon1006,MODcon1007,MODcon1008,MODcon1009,MODcon1011,MODcon1016,MODcon2026,MODcon2030,MODcon2031,MODcon2036,MODcon2037,MODcon2042,MODcon2046,MODcon2047,MODcon3063,MODcon3064,MODcon3066,MODcon3067,MODcon3068,MODcon3069,MODcon3070,MODcon3071,MODcon3087,MODcon3088,MODcon3090,MODcon3091,MODcon3093,MODcon3094,MODcon3095,MODcas4097,MODcas4098,MODcas4099,MODcas4100,MODcas4101,MODcas4102,MODcas4103,MODcas4104,MODcas4105,MODcas4106,MODcas4107,MODcas4108,MODcas4111,MODcas4112,MODcas4115,MODcas4116,MODcas4123,MODcas4124,MODcas4127,MODcas4128,MODcas4133,MODcas4134,MODcas4135,MODcas4136,MODcas4137,MODcas4138,MODcas4139,MODcas4140,MODcas4141,MODcas4142,MODcas4143,MODcas4144,MODcas5145,MODcas5147,MODcas5150,MODcas5152,MODcas5153,MODcas5154,MODcas5155,MODcas5156,MODcas5162,MODcas5163,MODcas5164,MODcas5166,MODcas5168,MODcas5169,MODcas5170,MODcas5173,MODcas5176,MODcas5177,MODcas5178,MODcas5179,MODcas5180,MODcas5181,MODcas5183,MODcas5184,MODcas5185,MODcas5186,MODcas5187,MODcas5188,MODcas5189,MODcas5190,MODcas5191,MODcas5192,MODcon4109,MODcon4110,MODcon4113,MODcon4114,MODcon4117,MODcon4118,MODcon4119,MODcon4120,MODcon4121,MODcon4122,MODcon4125,MODcon4126,MODcon4129,MODcon4130,MODcon4131,MODcon4132,MODcon5146,MODcon5148,MODcon5149,MODcon5151,MODcon5157,MODcon5158,MODcon5159,MODcon5160,MODcon5161,MODcon5165,MODcon5167,MODcon5171,MODcon5172,MODcon5174,MODcon5175,MODcon5182 -"seq1,seq2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 -"sequencing_site_1,sequencing_site_2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 -"test1,test2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 diff --git a/test/test_files/select_samples_list.txt b/test/test_files/select_samples_list.txt index 1c6f186..920b15c 100644 --- a/test/test_files/select_samples_list.txt +++ b/test/test_files/select_samples_list.txt @@ -1 +1 @@ -cas1001 cas1003 cas1005 cas1010 cas1012 +cas1001 cas1003 cas1005 cas1010 cas1012 \ No newline at end of file diff --git a/test/test_files/sig_list_50.csv b/test/test_files/sig_list_50.csv deleted file mode 100644 index 52f9d82..0000000 --- a/test/test_files/sig_list_50.csv +++ /dev/null @@ -1,477 +0,0 @@ -Chr,Start -chr1,865584 -chr1,865625 -chr1,865694 -chr1,887799 -chr1,889403 -chr1,949781 -chr1,1019513 -chr1,1115644 -chr1,1141824 -chr1,1168310 -chr1,1222895 -chr1,1222958 -chr1,1231280 -chr1,1245176 -chr1,1254483 -chr1,1262635 -chr1,1262958 -chr1,1275810 -chr1,1289446 -chr1,1391656 -chr1,1425753 -chr1,1431075 -chr1,1459235 -chr1,1847886 -chr1,1847952 -chr1,2075740 -chr1,2129498 -chr1,2252970 -chr1,2290143 -chr1,2411250 -chr1,2451384 -chr1,2524107 -chr1,2938887 -chr1,2938924 -chr1,3342635 -chr1,3389757 -chr1,3394464 -chr1,3424388 -chr1,3519162 -chr1,3551737 -chr1,3732885 -chr1,3807359 -chr1,3807590 -chr1,3809544 -chr1,5923427 -chr1,5923462 -chr1,5934652 -chr1,5940243 -chr1,5950975 -chr1,5965455 -chr1,6008178 -chr1,6046264 -chr1,6273206 -chr1,6304454 -chr1,6354992 -chr1,6528302 -chr1,6534643 -chr1,6615539 -chr1,6636662 -chr1,6637055 -chr1,6741027 -chr1,8075424 -chr1,9075221 -chr1,9097830 -chr1,9165669 -chr1,9307032 -chr1,9322376 -chr1,9324338 -chr1,9673046 -chr1,9714365 -chr1,9811653 -chr1,10316344 -chr1,10364385 -chr1,10394627 -chr1,10397567 -chr1,10521629 -chr1,10521657 -chr1,10523133 -chr1,10715845 -chr1,10725391 -chr1,10725413 -chr1,11009844 -chr1,11105539 -chr1,11106642 -chr1,11106666 -chr1,11106756 -chr1,11253684 -chr1,11561257 -chr1,11561489 -chr1,11766740 -chr1,11771929 -chr1,11772427 -chr1,11844424 -chr1,11852412 -chr1,11894340 -chr1,11983352 -chr1,12025600 -chr1,12027051 -chr1,12175658 -chr1,12202555 -chr1,12266982 -chr1,12309344 -chr1,12336265 -chr1,12423276 -chr1,12785295 -chr1,12819343 -chr1,12820808 -chr1,12919067 -chr1,14109023 -chr1,14109122 -chr1,15793937 -chr1,15850579 -chr1,16064670 -chr1,16069612 -chr1,16070820 -chr1,16071015 -chr1,16071058 -chr1,16255205 -chr1,16456763 -chr1,16461581 -chr1,16464612 -chr1,16531299 -chr1,16721628 -chr1,16736327 -chr1,16785378 -chr1,17250898 -chr1,17256491 -chr1,17256626 -chr1,17263214 -chr1,17263229 -chr1,17265416 -chr1,17270653 -chr1,17295659 -chr1,17323602 -chr1,17332012 -chr1,17420146 -chr1,17567149 -chr1,17570691 -chr1,17588689 -chr1,17607274 -chr1,17668888 -chr1,17681163 -chr1,17764914 -chr1,18023699 -chr1,18023729 -chr1,18152646 -chr1,18807521 -chr1,19166151 -chr1,19199448 -chr1,19500103 -chr1,19565736 -chr1,19600406 -chr1,20072108 -chr1,20073703 -chr1,20082247 -chr1,20442878 -chr1,20640926 -chr1,20644156 -chr1,20645086 -chr1,20998508 -chr1,21048472 -chr1,21050719 -chr1,21155679 -chr1,21180098 -chr1,22182115 -chr1,22199175 -chr1,22200947 -chr1,22202856 -chr1,22205601 -chr1,22895820 -chr1,22902833 -chr1,22903010 -chr1,22987340 -chr1,23233263 -chr1,23751126 -chr1,23760813 -chr1,23763767 -chr1,23763938 -chr1,24192068 -chr1,24192072 -chr1,24402675 -chr1,24417383 -chr1,24426249 -chr1,24669457 -chr1,24684715 -chr1,24993386 -chr1,25228786 -chr1,25572984 -chr1,25572985 -chr1,25573016 -chr1,25712269 -chr1,25889633 -chr1,25890247 -chr1,26110236 -chr1,26189517 -chr1,26317303 -chr1,26349754 -chr1,26357977 -chr1,26511622 -chr1,26514745 -chr1,26570744 -chr1,26644537 -chr1,26648745 -chr1,26663432 -chr1,26663749 -chr1,26672506 -chr1,26672647 -chr1,27120626 -chr1,27190196 -chr1,27278439 -chr1,27278589 -chr1,27661952 -chr1,27690792 -chr1,27877824 -chr1,27878341 -chr1,28206250 -chr1,28209484 -chr1,29342245 -chr1,31907027 -chr1,32145693 -chr1,32149760 -chr1,32162665 -chr1,32163632 -chr1,32164094 -chr1,32667609 -chr1,32674927 -chr1,32829448 -chr1,33160644 -chr1,33161113 -chr1,33333953 -chr1,33361287 -chr1,33366838 -chr1,33547930 -chr1,33562416 -chr1,34068114 -chr1,34090696 -chr1,34643521 -chr1,34667736 -chr1,35222995 -chr1,35223025 -chr1,35227033 -chr1,35227362 -chr1,35227466 -chr1,35250457 -chr1,35250892 -chr1,35915492 -chr1,36055616 -chr1,36060035 -chr1,36060056 -chr1,36074927 -chr1,36202128 -chr1,36636835 -chr1,36638146 -chr1,36638206 -chr1,36645615 -chr1,36859424 -chr1,36926307 -chr1,36933715 -chr1,37945956 -chr1,38032607 -chr1,38048504 -chr1,38078561 -chr1,38155366 -chr1,38155456 -chr1,38184055 -chr1,38227722 -chr1,38397417 -chr1,39305244 -chr1,39341749 -chr1,39720043 -chr1,39783025 -chr1,39797491 -chr1,39799912 -chr1,39853740 -chr1,39878567 -chr1,39894964 -chr1,39900230 -chr1,40131295 -chr1,40148308 -chr1,40226134 -chr1,40315880 -chr1,40315881 -chr1,40668255 -chr1,40703244 -chr1,40717144 -chr1,40928552 -chr1,40928563 -chr1,40928731 -chr1,40980668 -chr1,41092376 -chr1,41232317 -chr1,41948221 -chr1,41976291 -chr1,43205696 -chr1,43213903 -chr1,43223489 -chr1,43240998 -chr1,43317037 -chr1,43630315 -chr1,43738751 -chr1,43738760 -chr1,43897496 -chr1,43902992 -chr1,43917098 -chr1,44595524 -chr1,45166717 -chr1,45271250 -chr1,45307600 -chr1,45470328 -chr1,45479387 -chr1,45797228 -chr1,45797891 -chr1,45808982 -chr1,45923274 -chr1,45973124 -chr1,45973923 -chr1,46032311 -chr1,46034879 -chr1,46035599 -chr1,46086481 -chr1,46120313 -chr1,46182597 -chr1,46425062 -chr1,46495155 -chr1,46498071 -chr1,46499807 -chr1,46512266 -chr1,46739409 -chr1,46751616 -chr1,46768864 -chr1,46871409 -chr1,47278174 -chr1,47280830 -chr1,47280852 -chr1,47282755 -chr1,47603338 -chr1,47606567 -chr1,47653037 -chr1,48694594 -chr1,48696312 -chr1,48697277 -chr1,48703514 -chr1,48865121 -chr1,52859391 -chr1,53323033 -chr1,53372199 -chr1,53535766 -chr1,53569237 -chr1,53580545 -chr1,53662764 -chr1,53676278 -chr1,53676401 -chr1,53932322 -chr1,54661234 -chr1,55064970 -chr1,55070089 -chr1,55073623 -chr1,55085562 -chr1,55119654 -chr1,55134585 -chr1,55151994 -chr1,55207157 -chr1,55251778 -chr1,55307332 -chr1,55337163 -chr1,55518374 -chr1,55521701 -chr1,57207874 -chr1,57254697 -chr1,57254732 -chr1,57258382 -chr1,57333311 -chr1,57341737 -chr1,58996320 -chr1,59002282 -chr1,62299410 -chr1,62483560 -chr1,62593737 -chr1,62593749 -chr1,63999138 -chr1,64011657 -chr1,64017488 -chr1,64676452 -chr1,65095158 -chr1,67207066 -chr1,67313187 -chr1,67648596 -chr1,68904742 -chr1,71873154 -chr1,74507166 -chr1,74929131 -chr1,76226957 -chr1,76345823 -chr1,82456165 -chr1,82456585 -chr1,84867741 -chr1,84880427 -chr1,85331394 -chr1,85624747 -chr1,86048526 -chr1,86313374 -chr1,86374318 -chr1,86499587 -chr1,86591417 -chr1,86905888 -chr1,86961226 -chr1,89414937 -chr1,89637485 -chr1,89735081 -chr1,89735096 -chr1,89835209 -chr1,89844154 -chr1,91403431 -chr1,91973473 -chr1,92647250 -chr1,92709824 -chr1,94037267 -chr1,94047957 -chr1,94054790 -chr1,94140375 -chr1,94466624 -chr1,94473807 -chr1,94508386 -chr1,94528142 -chr1,94564483 -chr1,97547947 -chr1,97658762 -chr1,97770920 -chr1,97981377 -chr1,97981421 -chr1,98015291 -chr1,99161184 -chr1,99730100 -chr1,100154502 -chr1,100343254 -chr1,100376331 -chr1,100733836 -chr1,101458271 -chr1,103354135 -chr1,104117852 -chr1,104117921 -chr1,109446750 -chr1,109456983 -chr1,109456989 -chr1,109479959 -chr1,109486156 -chr1,109649162 -chr1,109794316 -chr1,109803697 -chr1,109806964 -chr1,109816189 -chr1,109823537 -chr1,109839482 -chr1,109840832 -chr1,109884672 -chrM,42 -chrM,57 -chrM,64 -chrM,72 -chrM,73 -chrM,89 -chrM,93 -chrM,42 -chrM,57 -chrM,64 -chrM,72 -chrM,73 -chrM,89 -chrM,93 -chrM,42 -chrM,57 -chrM,64 -chrM,72 -chrM,73 -chrM,89 -chrM,93 \ No newline at end of file diff --git a/test/test_files/significantList_for_proteinstructures.csv b/test/test_files/significantList_for_proteinstructures.csv deleted file mode 100644 index d3caff1..0000000 --- a/test/test_files/significantList_for_proteinstructures.csv +++ /dev/null @@ -1,346 +0,0 @@ -Chr,Start,End -7,107820766,107820766 -10,18823118,18823118 -5,75858342,75858342 -1,215955400,215955400 -10,103921902,103921902 -15,51504527,51504527 -5,75906878,75906878 -3,37336509,37336509 -7,55273086,55273086 -10,97181773,97181773 -7,107824933,107824933 -19,8438646,8438646 -22,38565367,38565367 -22,38516888,38516888 -1,158615114,158615114 -11,108196047,108196047 -9,116822533,116822533 -1,52276031,52276031 -21,27326979,27326979 -5,140482367,140482367 -6,32948407,32948407 -5,140481876,140481876 -1,23233449,23233449 -16,71570716,71570716 -19,50792831,50792831 -11,65733983,65733983 -7,36571909,36571909 -10,97111048,97111048 -1,216011439,216011439 -10,97143847,97143847 -2,219676971,219676971 -12,9349718,9349718 -1,230846251,230846251 -11,113604471,113604471 -20,62839649,62839649 -4,100239949,100239949 -5,140604606,140604606 -7,55210102,55210102 -12,118639252,118639252 -17,1968866,1968866 -17,7187350,7187350 -7,55220349,55220349 -11,108153603,108153603 -1,218614600,218614600 -2,219674423,219674423 -14,96707677,96707677 -12,21628447,21628447 -1,32165424,32165424 -12,9309938,9309938 -22,44323042,44323042 -2,219647056,219647056 -1,202457666,202457666 -21,36164834,36164834 -6,160966558,160966558 -12,118693291,118693291 -2,29416307,29416307 -3,171320960,171320960 -17,38457850,38457850 -17,29483109,29483109 -3,171362712,171362712 -13,52539048,52539048 -1,158585171,158585171 -4,3210535,3210535 -6,42044948,42044948 -10,26558065,26558065 -22,39477217,39477217 -6,161027620,161027620 -19,828331,828331 -14,89647121,89647121 -5,75948599,75948599 -1,216373405,216373405 -6,160968823,160968823 -1,216256917,216256917 -6,44197339,44197339 -4,100137322,100137322 -17,79496230,79496230 -3,155198945,155198945 -22,36710225,36710225 -17,7803295,7803295 -9,99301421,99301421 -1,216062274,216062274 -8,67356627,67356627 -22,39479866,39479866 -7,48019089,48019089 -19,43373084,43373084 -22,36680275,36680275 -1,20417111,20417111 -15,85487844,85487844 -9,125152576,125152576 -1,186957563,186957563 -2,227660777,227660777 -11,125503234,125503234 -22,35811891,35811891 -2,98354293,98354293 -1,156845901,156845901 -X,9905377,9905377 -1,158655115,158655115 -19,8436190,8436190 -1,114445423,114445423 -17,7814850,7814850 -19,43382122,43382122 -20,48140627,48140627 -1,160851925,160851925 -6,32943853,32943853 -10,18828340,18828340 -1,79128419,79128419 -4,100131283,100131283 -5,96315087,96315087 -8,67366374,67366374 -12,21639446,21639446 -14,95058568,95058568 -6,45917083,45917083 -16,18847261,18847261 -1,161753840,161753840 -1,230841749,230841749 -5,89910784,89910784 -17,31324782,31324782 -2,29416157,29416157 -4,100349052,100349052 -5,89925235,89925235 -5,89939702,89939702 -6,160998277,160998277 -10,34420423,34420423 -12,21627889,21627889 -22,44328870,44328870 -2,227659841,227659841 -7,150553850,150553850 -13,35751209,35751209 -16,10996598,10996598 -1,179308668,179308668 -2,219678828,219678828 -3,108396420,108396420 -12,6927631,6927631 -12,104152923,104152923 -13,52549234,52549234 -15,40581499,40581499 -15,85461828,85461828 -19,50789904,50789904 -12,117693826,117693826 -13,96415910,96415910 -10,96013948,96013948 -11,65744142,65744142 -17,74324920,74324920 -1,156838333,156838333 -3,121377175,121377175 -3,196817888,196817888 -10,95892019,95892019 -19,7831075,7831075 -19,43372429,43372429 -22,35812389,35812389 -22,36682799,36682799 -12,9344824,9344824 -1,79125064,79125064 -12,21652503,21652503 -1,158583604,158583604 -1,216166497,216166497 -19,50810310,50810310 -3,196812562,196812562 -5,140603373,140603373 -X,9905243,9905243 -6,36063793,36063793 -15,93557995,93557995 -13,48919246,48919246 -1,20248865,20248865 -1,153271682,153271682 -4,100229021,100229021 -5,140475212,140475212 -12,53553459,53553459 -13,52534412,52534412 -20,48140696,48140696 -1,156843514,156843514 -15,51507312,51507312 -1,158622275,158622275 -11,27147215,27147215 -1,202462266,202462266 -9,104124970,104124970 -1,12012777,12012777 -4,100045615,100045615 -12,53553998,53553998 -12,118693338,118693338 -15,85467271,85467271 -22,35799487,35799487 -22,44328930,44328930 -10,97144031,97144031 -12,117723115,117723115 -4,153332477,153332477 -1,158627464,158627464 -9,21187025,21187025 -12,104054503,104054503 -5,89979833,89979833 -1,202411679,202411679 -5,35065513,35065513 -5,75913949,75913949 -11,65733685,65733685 -17,76219646,76219646 -7,2108927,2108927 -20,23729763,23729763 -14,96703491,96703491 -5,90059182,90059182 -3,127540645,127540645 -13,52509155,52509155 -15,40584641,40584641 -3,2924838,2924838 -19,50789785,50789785 -5,89949605,89949605 -20,62839672,62839672 -9,21187428,21187428 -11,108117787,108117787 -17,31324523,31324523 -1,114442885,114442885 -1,158621236,158621236 -1,160846462,160846462 -1,154427032,154427032 -1,230840034,230840034 -1,23233263,23233263 -1,158582637,158582637 -1,216420190,216420190 -4,100240016,100240016 -5,89948228,89948228 -3,123376274,123376274 -1,158637704,158637704 -3,130698145,130698145 -6,33048707,33048707 -14,96707675,96707675 -4,3133113,3133113 -11,100999579,100999579 -13,31714379,31714379 -2,219677022,219677022 -6,110734638,110734638 -15,60641300,60641300 -6,160966559,160966559 -18,61647120,61647120 -3,155200344,155200344 -1,32164127,32164127 -6,45909349,45909349 -7,39726270,39726270 -10,34408649,34408649 -7,150557707,150557707 -10,97174316,97174316 -13,48955458,48955458 -1,230846446,230846446 -4,3109095,3109095 -3,108324270,108324270 -5,140481477,140481477 -9,125140732,125140732 -12,117768154,117768154 -17,76219611,76219611 -4,103528817,103528817 -19,830841,830841 -3,121491422,121491422 -5,89943443,89943443 -11,108119823,108119823 -13,28885760,28885760 -19,8429328,8429328 -5,90055259,90055259 -X,9863944,9863944 -11,128354963,128354963 -1,202418250,202418250 -5,140481132,140481132 -3,37366882,37366882 -5,140480658,140480658 -5,90074869,90074869 -11,65733957,65733957 -5,140517069,140517069 -22,19482035,19482035 -16,3023185,3023185 -2,234250961,234250961 -20,61485507,61485507 -5,147491402,147491402 -1,161736197,161736197 -19,50747534,50747534 -1,215847490,215847490 -5,75948620,75948620 -7,108155377,108155377 -22,44324767,44324767 -11,65735168,65735168 -5,125919644,125919644 -4,100229016,100229016 -3,121527826,121527826 -1,27744825,27744825 -5,89988549,89988549 -12,9349714,9349714 -16,71571658,71571658 -12,114837349,114837349 -2,234229468,234229468 -1,23233346,23233346 -20,23807162,23807162 -1,12025600,12025600 -17,2203109,2203109 -20,29960701,29960701 -1,160846458,160846458 -20,23807093,23807093 -X,9864406,9864406 -5,89979568,89979568 -5,140476283,140476283 -9,21201831,21201831 -22,39441093,39441093 -3,155314114,155314114 -3,15297787,15297787 -3,108324261,108324261 -9,133769023,133769023 -5,125880710,125880710 -5,89943581,89943581 -5,7892937,7892937 -5,89925169,89925169 -17,29559093,29559093 -1,20302201,20302201 -22,44335885,44335885 -1,215802247,215802247 -1,153279597,153279597 -22,36745146,36745146 -11,108175463,108175463 -22,44342175,44342175 -16,18937330,18937330 -5,140480475,140480475 -9,99296250,99296250 -16,18879528,18879528 -5,140604419,140604419 -13,36239272,36239272 -5,89989802,89989802 -5,89920969,89920969 -X,9907369,9907369 -9,133768966,133768966 -12,6925294,6925294 -12,53564257,53564257 -7,139719829,139719829 -11,108098576,108098576 -5,140604621,140604621 -9,125152621,125152621 -1,111957370,111957370 -5,140475665,140475665 -19,48602951,48602951 -10,18828486,18828486 -7,36657926,36657926 -1,20305003,20305003 -17,76219685,76219685 -13,31729776,31729776 -5,90016778,90016778 -22,44342174,44342174 -3,113002475,113002475 -6,108985893,108985893 -19,50720949,50720949 -19,39379770,39379770 -6,152129399,152129399 -X,9863426,9863426 \ No newline at end of file diff --git a/test/test_files/test_sample_phenotype_matrix.csv b/test/test_files/test_sample_phenotype_matrix.csv deleted file mode 100644 index 58fe0e6..0000000 --- a/test/test_files/test_sample_phenotype_matrix.csv +++ /dev/null @@ -1,4 +0,0 @@ -id,cas1001,cas1003,cas1005,cas1010,cas1012,cas1013,cas1014,cas1015,cas1017,cas1018,cas1019,cas1020,cas1021,cas1022,cas1023,cas1024,cas2025,cas2027,cas2028,cas2029,cas2032,cas2033,cas2034,cas2035,cas2038,cas2039,cas2040,cas2041,cas2043,cas2044,cas2045,cas2048,cas3050,cas3051,cas3052,cas3053,cas3054,cas3055,cas3056,cas3057,cas3058,cas3059,cas3060,cas3061,cas3062,cas3065,cas3072,cas3073,cas3074,cas3075,cas3076,cas3077,cas3078,cas3079,cas3080,cas3081,cas3082,cas3083,cas3084,cas3085,cas3086,cas3089,cas3092,cas3096,con1002,con1004,con1006,con1007,con1008,con1009,con1011,con1016,con2026,con2030,con2031,con2036,con2037,con2042,con2046,con2047,con3063,con3064,con3066,con3067,con3068,con3069,con3070,con3071,con3087,con3088,con3090,con3091,con3093,con3094,con3095,cas4097,cas4098,cas4099,cas4100,cas4101,cas4102,cas4103,cas4104,cas4105,cas4106,cas4107,cas4108,cas4111,cas4112,cas4115,cas4116,cas4123,cas4124,cas4127,cas4128,cas4133,cas4134,cas4135,cas4136,cas4137,cas4138,cas4139,cas4140,cas4141,cas4142,cas4143,cas4144,cas5145,cas5147,cas5150,cas5152,cas5153,cas5154,cas5155,cas5156,cas5162,cas5163,cas5164,cas5166,cas5168,cas5169,cas5170,cas5173,cas5176,cas5177,cas5178,cas5179,cas5180,cas5181,cas5183,cas5184,cas5185,cas5186,cas5187,cas5188,cas5189,cas5190,cas5191,cas5192,con4109,con4110,con4113,con4114,con4117,con4118,con4119,con4120,con4121,con4122,con4125,con4126,con4129,con4130,con4131,con4132,con5146,con5148,con5149,con5151,con5157,con5158,con5159,con5160,con5161,con5165,con5167,con5171,con5172,con5174,con5175,con5182 -"seq1,seq2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 -"sequencing_site_1,sequencing_site_2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 -"test1,test2",1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 \ No newline at end of file diff --git a/viva b/viva index 79ec1b4..3572997 100755 --- a/viva +++ b/viva @@ -54,12 +54,11 @@ function test_parse_main(ARGS::Vector{String}) default = "html" "--genomic_range", "-r" - help = "select rows within a given chromosome range. Provide chromosome range after this flag." + help = "select rows within a given chromosome range. Provide chromosome range after this flag in format chr4:20000000-30000000." arg_type = String "--pass_filter", "-p" - help = "select rows within a given chromosome range. Provide chromosome range after this flag in format chr4:20000000-30000000" - arg_type = String + help = "select rows with PASS in the FILTER field." action = :store_true "--positions_list", "-l" @@ -99,6 +98,12 @@ function test_parse_main(ARGS::Vector{String}) "--avg_dp" help = "visualize average read depths as line chart. Options: average sample read depth, average variant read depth, or both. eg. =sample, =variant, =sample,variant" + + "--save_remotely" + help = "Specify filename for heatmap with underscores for spaces." + action = :store_true + + #nargs = 2 #metavar = ["avg_option", "markers_or_lines"] #default = ["variant,sample", "markers"] @@ -134,6 +139,8 @@ sample_names = get_sample_names(reader) save_ext = parsed_args["save_format"] +remote_option = parsed_args["save_remotely"] + VIVA.checkfor_outputdirectory(parsed_args["output_directory"]) output_directory=parsed_args["output_directory"] @@ -311,7 +318,7 @@ if parsed_args["heatmap"] == "genotype" println("Saving genotype heatmap") - save_graphic(graphic,output_directory,save_ext,title) + save_graphic(graphic,output_directory,save_ext,title,remote_option) end @@ -379,7 +386,7 @@ if parsed_args["heatmap"] == "read_depth" println("Saving read depth heatmap") - save_graphic(graphic,output_directory,save_ext,title) + save_graphic(graphic,output_directory,save_ext,title,remote_option) end if parsed_args["heatmap"] == "genotype,read_depth" || parsed_args["heatmap"] == "read_depth,genotype" @@ -448,7 +455,7 @@ if parsed_args["heatmap"] == "genotype,read_depth" || parsed_args["heatmap"] == save_numerical_array(gt_num_array,sample_names,chr_pos_tuple_list,title,output_directory) end - save_graphic(graphic,output_directory,save_ext,title) + save_graphic(graphic,output_directory,save_ext,title,remote_option) if parsed_args["heatmap_title"] != nothing title = "Read_Depth_$(parsed_args["heatmap_title"])" @@ -509,7 +516,7 @@ if parsed_args["heatmap"] == "genotype,read_depth" || parsed_args["heatmap"] == println("Saving read depth heatmap") - save_graphic(graphic,output_directory,save_ext,title) + save_graphic(graphic,output_directory,save_ext,title,remote_option) end @@ -530,7 +537,7 @@ if parsed_args["avg_dp"] == "sample" bn = Base.Filesystem.basename(parsed_args["vcf_file"]) title = "Average_Sample_Read_Depth_$bn" - save_graphic(graphic,output_directory,save_ext,title) + save_graphic(graphic,output_directory,save_ext,title,remote_option) elseif parsed_args["avg_dp"] == "variant" @@ -550,7 +557,7 @@ elseif parsed_args["avg_dp"] == "variant" title = "Average_Variant_Read_Depth$bn" graphic = avg_variant_dp_line_chart(avg_list,chr_pos_tuple_list,y_axis_label_option,chrom_label_info) - save_graphic(graphic,output_directory,save_ext,title) + save_graphic(graphic,output_directory,save_ext,title,remote_option) elseif parsed_args["avg_dp"] == "variant,sample" || parsed_args["avg_dp"] == "sample,variant" @@ -570,7 +577,7 @@ elseif parsed_args["avg_dp"] == "variant,sample" || parsed_args["avg_dp"] == "sa title = "Average_Variant_Read_Depth$bn" graphic = avg_variant_dp_line_chart(avg_list,chr_pos_tuple_list,y_axis_label_option,chrom_label_info) - save_graphic(graphic,output_directory,save_ext,title) + save_graphic(graphic,output_directory,save_ext,title,remote_option) avg_list = VIVA.avg_dp_samples(dp_num_array) list = VIVA.list_sample_names_low_dp(avg_list, sample_names) @@ -582,7 +589,7 @@ elseif parsed_args["avg_dp"] == "variant,sample" || parsed_args["avg_dp"] == "sa graphic = avg_sample_dp_scatter(avg_list,sample_names,x_axis_label_option) - save_graphic(graphic,output_directory,save_ext,title) + save_graphic(graphic,output_directory,save_ext,title,remote_option) elseif parsed_args["avg_dp"] != nothing println("--avg_dp flag did not find expected arguments: sample, variant, or sample,variant. Average read depth plot not saved.")