Skip to content

Commit

Permalink
Merge pull request #2 from warthmann/developer
Browse files Browse the repository at this point in the history
Developer
  • Loading branch information
warthmann authored Nov 18, 2019
2 parents e488147 + 06445ca commit fc0e856
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 54 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ output/*
!output/readme

# rawdata (size problem)
genomes_and_annotations/snpeffdata/
genomes_and_annotations/*
!genomes_and_annotations/readme


# Notes and experiments
todo
Expand Down
2 changes: 1 addition & 1 deletion Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ rule all:
rules.align.input,
rules.varcall.input,
rules.stats.input,
rules.snpeff.output,
# rules.snpeff.output,
9 changes: 5 additions & 4 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ qc:
mapping:
aligners:
- bwa
- ngm
refs:
- Sorghum_bicolor_NCBIv3.42
samplesets:
Expand Down Expand Up @@ -65,14 +66,14 @@ LB-impute:
denovodist:
kwip_sketchsize: 1e9
mash_sketchsize: 1e5
sourmash_sketchsize: 1e5
sourmash_sketchsize: 100000
ksize: 21
kwip_sets: []
kwip_sets:
- all_samples
mash_sets: # we can subset from everything for (sour)mash
- all_samples
sourmash_sets: []


varcall:
minmapq:
bwa: 30
Expand All @@ -82,7 +83,7 @@ varcall:
chunksize: 1000000
aligners:
- bwa
#- ngm
- ngm
callers:
#- mpileup
- freebayes
Expand Down
12 changes: 12 additions & 0 deletions envs/additional.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#conda env update --name my_env --file additional.yml
#name: paneuc
channels:
- defaults
- bioconda
- conda-forge
- r
dependencies:
- qualimap
- r-rgl
- r-devtools
- r-vcfr
15 changes: 8 additions & 7 deletions envs/condaenv.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
name: paneuc
#name: paneuc
channels:
- defaults
- bioconda
- conda-forge
- r
# - r
dependencies:
- python=3.*
- snakemake
- yamlordereddictloader
- bwa
- freebayes
- vt
- samtools
- bcftools
- bedops
- qualimap
- AdapterRemoval
- seqhax
- pigz
- matplotlib =2.2
- pandas =0.23
- seaborn =0.8
- r-rgl
- r-devtools
- rust
- khmer
- r-ggplot2
- r-vcfr
- kwip
- mash
- pysam
- nextgenmap
- sourmash
34 changes: 1 addition & 33 deletions genomes_and_annotations/readme
Original file line number Diff line number Diff line change
@@ -1,38 +1,6 @@
genomes_and_annotations/
├── readme
├── snpeffdata
│   ├── genomes
│   │   └── Sorghum_bicolor_NCBIv3.42.fa
│   ├── Readme
│   └── Sorghum_bicolor_NCBIv3.42
│   ├── genes.gtf.gz
│   ├── sequence.10.bin
│   ├── sequence.1.bin
│   ├── sequence.2.bin
│   ├── sequence.3.bin
│   ├── sequence.4.bin
│   ├── sequence.5.bin
│   ├── sequence.6.bin
│   ├── sequence.7.bin
│   ├── sequence.8.bin
│   ├── sequence.9.bin
│   ├── sequence.bin
│   └── snpEffectPredictor.bin
├── Sorghum
│   ├── Sorghum.fa
│   ├── Sorghum.fa.amb
│   ├── Sorghum.fa.ann
│   ├── Sorghum.fa.bwt
│   ├── Sorghum.fa.fai
│   ├── Sorghum.fa.pac
│   └── Sorghum.fa.sa
└── Sorghum_bicolor_NCBIv3.42
├── Sorghum_bicolor_NCBIv3.42.fa
├── Sorghum_bicolor_NCBIv3.42.fa.amb
├── Sorghum_bicolor_NCBIv3.42.fa.ann
├── Sorghum_bicolor_NCBIv3.42.fa.bwt
├── Sorghum_bicolor_NCBIv3.42.fa.fai
├── Sorghum_bicolor_NCBIv3.42.fa.pac
└── Sorghum_bicolor_NCBIv3.42.fa.sa

5 directories, 30 files
2 directories, 1 file
2 changes: 1 addition & 1 deletion rules/align.rules.smk
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ rule qualimap_samp:
input:
bam="output/alignments/samples/{aligner}/{ref}/{sample}.bam",
output:
"output/alignments/qualimap/samples/{aligner}~{ref}~{sample}/",
directory("output/alignments/qualimap/samples/{aligner}~{ref}~{sample}/"),
log:
"output/log/align/qualimap_sample/{aligner}~{ref}~{sample}.log"
threads: 4
Expand Down
21 changes: 15 additions & 6 deletions rules/denovo.rules.smk
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,31 @@ rule mash:
sketchsize=config["denovodist"]["mash_sketchsize"],
set=config["denovodist"]["mash_sets"]),

rule pca:
rule pca_mash:
input:
rules.mash.input,
rules.mash.input,
output:
"output/plots/denovo/mash/pca.pdf",
script:
"../scripts/pca_mash.R"

rule pca_kwip:
input:
rules.kwip.input,
output:
"output/plots/denovo/mash/pca.pdf"
"output/plots/denovo/kwip/pca.pdf",
script:
"../scripts/pca.R"
"../scripts/pca_kwip.R"



rule denovo:
input:
rules.kwip.input,
rules.mash.input,
rules.sourmash.input,
rules.pca.output,

rules.pca_mash.output,
rules.pca_kwip.output,

##### Actual rules #####

Expand Down
2 changes: 1 addition & 1 deletion rules/snpeff.rules.smk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rule snpeff:
"output/log/snpeff/snpeff.log"
params:
reference=config["snpeff"]['name'],
extra="-Xmx6g"
extra="-Xmx6g -v"
wrapper:
"0.27.1/bio/snpeff"

Expand Down
3 changes: 3 additions & 0 deletions scripts/pca.R → scripts/pca_kwip.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ print (snakemake@output[[1]])

y0<-read.delim(snakemake@input[[1]], header=T)
data<-as.matrix(y0[, -1])
labels<-colnames(data)
pca <- prcomp(data, scale=F)
print ('PCA done!')
plot3d(pca$x[,c(1,2,3)], size=10)
text3d(pca$x[,c(1,2,3)], text=labels)
rgl.postscript(snakemake@output[[1]],"pdf")
rgl.postscript(snakemake@output[[1]],"svg")

15 changes: 15 additions & 0 deletions scripts/pca_mash.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
library(rgl)

print (snakemake@input[[1]])
print (snakemake@output[[1]])

y0<-read.delim(snakemake@input[[1]], header=T)
data<-as.matrix(y0[, -1])
labels<-as.data.frame(do.call(rbind, strsplit(colnames(data), "[.]")))$V4
pca <- prcomp(data, scale=F)
print ('PCA done!')
plot3d(pca$x[,c(1,2,3)], size=10)
text3d(pca$x[,c(1,2,3)], text=labels)
rgl.postscript(snakemake@output[[1]],"pdf")
rgl.postscript(snakemake@output[[1]],"svg")

0 comments on commit fc0e856

Please sign in to comment.