-
Notifications
You must be signed in to change notification settings - Fork 2
Cookbook
Jim Shaw edited this page Oct 18, 2024
·
7 revisions
devider -b sorted_indexed.bam -v snps.vcf.gz -r reference.fa -o output -t 10 --preset nanopore-r9-
-b: sorted and indexed BAM file -
-v: VCF file with header -
-r: reference file (same reference as your BAM file) -
-t: number of threads
Tip
You may need to run bgzip snps.vcf; tabix snps.vcf.gz if your vcf does not have a header.
About --preset: we offer four presets parameter choices. old-long-reads, nanopore-r9, nanopore-r10, hi-fi. See the advanced usage manual for more information. In short, use:
-
old-long-readsfor ~90% identity long reads -
nanopore-r9for ~95% (default) -
nanopore-r10for ~98% -
hi-fifor true high fidelity reads (> 99.9% accuracy).
haplotag_bam sorted_indexed.bam -i output/ids.txt
ls sorted_indexed.bam.tagged.bam
#visualize the tagged bam file in IGV.haplotag_bam is available in the conda install (or in scripts/). This generates a haplotagged bam file with HP:i tags for each read, allowing easy visualization in IGV.
run_devider_pipeline -i reads.fq.gz -r reference.fa -o pipeline_output -t 10 --devider-options "min-cov=10 allele-output preset=nanopore-r10"This is just a light wrapper around minimap2, LoFreq, and devider. This comes with the conda install or is available through the scripts/ folder.
-
-i: your reads -
-r: reference file to map and call variants -
-o: output folder -
-t: number of threads for each pipeline step (minimap2, lofreq, then devider) -
--devider-options: you can set options fordeviderby writing the long-form option and usinglong-form=valuefor options with values.
devider ... --bed-file regions.bed
devider ... --sequence-to-phase NC_001802.1:1-1000,NC_001592.1:5000-6000
# pipeline version
run_devider_pipeline --devider-options="bed-file=regions.bed"-
--bed-file: A >= 3 column bed file (only the first 3 matter) with contig id, start position, and end position. Each region will be haplotyped. You can specify multiple regions per contig. -
--sequenced-to-phase: specify the region/contig to phase incontig:start-endformat. Multiple regions can be separated by a comma.
devider ... -o output --allele-output --output-reads
head output/reads.fq
# obtain all reads for Haplotype:1
grep -A3 Haplotype:1 devider_pipeline_output/reads.fq | grep -v '^--' > haplotype_1_reads.fq-
--allele-output: output base-level alleles instead of0,1alleles forsnp_haplotypes.fasta. See the page on devider's outputs for more info. -
--output-reads: outputs the reads in fastq format inoutput/reads.fq. These reads are tagged by their haplotype.