Skip to content

Commit

Permalink
feat(mergeupdates): merge new features, functions, and passing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandogelin committed Mar 1, 2019
2 parents b816a26 + 911eb52 commit ff9d125
Show file tree
Hide file tree
Showing 19 changed files with 1,873 additions and 527 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
*.html
.DS_Store
.ipynb_checkpoints/
output
Manifest.toml
36 changes: 25 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
## Documentation: http://docs.travis-ci.com/user/languages/julia/
language: julia

os:
- linux
- osx

julia:
- 0.6
- 1.1

notifications:
email: false
Expand All @@ -15,19 +16,32 @@ git:

before_script:
- export PATH=$HOME/.local/bin:$PATH

script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia --check-bounds=yes -e 'Pkg.clone(pwd()); Pkg.pin("Blink", v"0.6.2"); Pkg.pin("PlotlyJS", v"0.10.2"); Pkg.build("Blink"); Pkg.build("ViVa"); Pkg.test("ViVa"; coverage=true)'


after_success:
- julia -e 'Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
- julia -e 'import Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'

jobs:
include:
- stage: deploy docs
language: julia
- stage: "Deploy Documentation"
julia: 1.1
os: linux
script:
- julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- julia --project=docs/ docs/make.jl
after_success: skip

- stage: Semantic Release
if: branch = master AND type != pull_request
language: python
os: linux
julia: 0.6
python: 3.6
before_script: skip
install:
- pip install typing
- pip install python-semantic-release
script:
- julia -e 'Pkg.add("Documenter"); include(joinpath("docs", "make.jl"))'
- git config --global user.name "semantic-release (via TravisCI)"
- git config --global user.email "semantic-release@travis"
- semantic-release publish
after_script: skip
after_success: skip
18 changes: 18 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name = "VIVA"
uuid = "d7f9f8fa-e687-11e8-2c0b-eb4ab256ef6a"
authors = ["George Tollefson <[email protected]>"]
version = "0.0.1"

[deps]
ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
Blink = "ad839575-38b3-5650-b840-f874b8c74a25"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
GeneticVariation = "9bc6ac9d-e6b2-5f70-b0a8-242a01662520"
ORCA = "47be7bcc-f1a6-5447-8b36-7eeeff7534fd"
PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a"
Rsvg = "c4c386cf-5103-5370-be45-f3a111cca3b8"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
julia = ">=0.7"
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[semantic_release]
version_variable=Project.toml:version
upload_to_pypi=false
92 changes: 92 additions & 0 deletions src/VIVA.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
module VIVA

using DataFrames
using PlotlyJS
using ORCA
using Rsvg
using Blink
using GeneticVariation
using ArgParse
using DelimitedFiles
using Test

#using Base.Filesystem

#include("vcf_utils.jl")
#include("plot_utils.jl")

#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,
clean_column1!,
genotype_cell_searcher_maf_correction,
genotype_cell_searcher,
dp_cell_searcher,
load_siglist,
sig_list_vcf_filter,
chromosome_range_vcf_filter,
load_sort_phenotype_matrix,
reorder_columns,
select_columns,
genotype_heatmap2,
dp_heatmap2,
avg_sample_dp_scatter,
avg_variant_dp_line_chart,
read_depth_threshhold,
list_variant_positions_low_dp,
list_sample_names_low_dp,
avg_dp_variant,
avg_dp_samples,
jupyter_main,
save_numerical_array,
io_pass_filter,
io_sig_list_vcf_filter,
io_chromosome_range_vcf_filter,
generate_genotype_array,
define_geno_dict,
translate_genotype_to_num_array,
translate_readdepth_strings_to_num_array,
genotype_heatmap_with_groups,
jupyter_main_new,
returnXY_column1!,
pass_chrrange_siglist_filter,
pass_chrrange_filter,
pass_siglist_filter,
chrrange_siglist_filter,
get_sample_names,
sortcols_by_phenotype_matrix,
find_group_label_indices,
checkfor_outputdirectory,
combined_all_genotype_array_functions,
combined_all_read_depth_array_functions,
combined_all_read_depth_array_functions_for_avg_dp,
generate_chromosome_positions_for_hover_labels,
clean_column1_chr,
clean_column1_siglist!,
process_plot_inputs,
process_plot_inputs_for_grouped_data,
returnXY_column1_siglist!,
chromosome_label_generator,
add_pheno_matrix_to_gt_data_for_plotting,
add_pheno_matrix_to_dp_data_for_plotting,
generate_hover_text_array,
generate_hover_text_array_grouped,
save_graphic

#include("vcf_utils.jl")
include("vcf_utils_complete.jl")
include("plot_utils.jl")
include("new_notebook_utils.jl")
#include("v1_VIVA_notebook_utils.jl")
#include("io_filters.jl")

end # module
23 changes: 17 additions & 6 deletions src/ViVa.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
module ViVa
module VIVA

using DataFrames
using PlotlyJS
using ORCA
using Rsvg
using Blink
using GeneticVariation
using ArgParse
#using VCFTools
#using Base.Filesystem

using DelimitedFiles
using Test

#using Base.Filesystem

#include("vcf_utils.jl")
#include("plot_utils.jl")
Expand Down Expand Up @@ -67,15 +68,25 @@ export
checkfor_outputdirectory,
combined_all_genotype_array_functions,
combined_all_read_depth_array_functions,
combined_all_read_depth_array_functions_for_avg_dp,
generate_chromosome_positions_for_hover_labels,
clean_column1_chr,
clean_column1_siglist!
clean_column1_siglist!,
process_plot_inputs,
process_plot_inputs_for_grouped_data,
returnXY_column1_siglist!,
chromosome_label_generator,
add_pheno_matrix_to_gt_data_for_plotting,
add_pheno_matrix_to_dp_data_for_plotting,
generate_hover_text_array,
generate_hover_text_array_grouped,
save_graphic

#include("vcf_utils.jl")
include("vcf_utils_complete.jl")
include("plot_utils.jl")
#include("notebook_utils.jl")
include("new_notebook_utils.jl")
#include("v1_VIVA_notebook_utils.jl")
#include("io_filters.jl")

end # module
24 changes: 4 additions & 20 deletions src/new_notebook_utils.jl
Original file line number Diff line number Diff line change
@@ -1,28 +1,12 @@
"""
jupyter_main(vcf_filename,field_to_visualize,variant_filter,sample_filter,plot_types,save_format,plot_title,plot_labels)
jupyter_main(vcf_filename,field_to_visualize,variant_filter,sample_filter,plot_types,save_format,plot_title,plot_labels,output_directory::String)
filters, plots visualization, and saves as figure.
utilizes all global variables set in first cell of jupyter notebook
"""
function jupyter_main_new(vcf_filename::String,field_to_visualize::String,variant_filter::Array{String,1},sample_filter::Array{String,1},plot_types::Array{String,1},save_format::String,plot_title::String,output_directory::String)

println("loading packages...")

println("finished loading packages")
#show stats
#=
number_records = nrecords(vcf_filename)
number_samples = nsamples(vcf_filename)
println("_______________________________________________")
println()
println("Summary Statistics of $(parsed_args["vcf_file"])")
println()
println("number of records: $number_records")
println("number of samples: $number_samples")
println("_______________________________________________")
println()
=#

#create vcf reader object
println("Reading $vcf_filename")
reader = VCF.Reader(open(vcf_filename, "r")) #reader = VCF.Reader(open("test_4X_191.vcf", "r"))
Expand Down Expand Up @@ -255,8 +239,8 @@ elseif field_to_visualize == "read_depth"
list = ViVa.list_sample_names_low_dp(avg_list, sample_names)
writedlm(joinpath("$output_directory","Samples_with_low_dp.txt"),list, ",")
#println("The following samples have read depth of under 15: $list")
avg_sample_dp_line_chart(avg_list)
graphic = avg_sample_dp_line_chart(avg_list)
avg_sample_dp_scatter(avg_list)
graphic = avg_sample_dp_scatter(avg_list)
PlotlyJS.savefig(graphic, joinpath("$output_directory" ,"Average Sample Read Depth.$save_format"))
return graphic

Expand Down
Loading

0 comments on commit ff9d125

Please sign in to comment.