### Test SVLearn Installation Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Navigate to the test directory and execute the test script to verify SVLearn installation. ```bash cd test bash test.sh ``` -------------------------------- ### Build SVLearn from Tarball Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Extract the SVLearn tarball, navigate into the directory, download the 'paragraph' binary, unzip it, and then run the installation script. Ensure the conda environment is activated. ```bash tar xvzf svlearn-0.0.5.tar.gz cd svlearn-0.0.5 wget https://github.com/Illumina/paragraph/releases/download/v2.4a/paragraph-v2.4a-binary.zip unzip -q paragraph-v2.4a-binary.zip -d bin/paragraph-v2.4a bash install.sh ``` -------------------------------- ### Build SVLearn from Git Repository Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Clone the SVLearn repository, change into the directory, download the 'paragraph' binary, unzip it, and execute the installation script. This method requires an activated conda environment. ```bash git clone https://github.com/yangqimeng99/svlearn.git cd svlearn wget https://github.com/Illumina/paragraph/releases/download/v2.4a/paragraph-v2.4a-binary.zip unzip -q paragraph-v2.4a-binary.zip -d bin/paragraph-v2.4a bash install.sh ``` -------------------------------- ### Create and Activate Conda Environment for SVLearn Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Use this command to create a new conda environment named 'svlearn' with all the specified Python packages and dependencies. Activate the environment before proceeding with the installation. ```bash conda create -n svlearn python=3.9 bioconda::pysam=0.22.0 polars=0.20.15 pandas=2.2.1 scikit-learn=1.3.0 bioconda::pyfaidx pyarrow bioconda::pybedtools conda-forge::intervaltree conda activate svlearn ``` -------------------------------- ### Run Cattle 18 Feature Demo Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Demonstrates SVLearn's genotyping and benchmarking capabilities on a cattle dataset with 18 features. This process is expected to take approximately 5 minutes on a single CPU core with 16GB of memory. ```bash svlearn genotype \ -v 02.SV-set_Genomes/cattle_ref_sorted_format_filtered_sv.vcf \ -m Cattle_18feature_RandomForest_model.joblib \ -s 04.validation-dataset/cattle/Cattle_SV_Set-sv_feature.tsv \ -a 04.validation-dataset/cattle/Charolais_30x/BreakPoint_ReadDepth_2Bam_feature.tsv \ -o Charolais_30_svlearn_genotype.vcf \ -n Charolais_30 svlearn benchmark \ -b 04.validation-dataset/cattle/Cattle_SV_Set-Charolais_True_GT.vcf \ -c Charolais_30_svlearn_genotype.vcf \ -o Charolais_30_svlearn.bench.tsv \ -n1 Charolais -n2 Charolais_30 ``` -------------------------------- ### SVLearn Benchmark Command Line Arguments Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md This snippet shows the usage and available arguments for the `svlearn benchmark` command. Use this to understand the required inputs for comparing VCF files. ```bash svlearn benchmark usage: svlearn benchmark [-h] -b file -c file -n1 str -n2 str [-o file] -h, --help show this help message and exit -b, --base_set file True sv vcf set -c, --call_set file Call sv vcf set -n1, --base_sample_name str Sample name in true sv vcf set -n2, --call_sample_name str Sample name in call sv vcf set -o, --out file The out of bechmark result, Default: benchmark.result.tsv ``` -------------------------------- ### Run Human 24 Feature Demo Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Demonstrates SVLearn's genotyping and benchmarking capabilities on a human dataset with 24 features. This process is expected to take approximately 5 minutes on a single CPU core with 16GB of memory. ```bash svlearn genotype \ -v 02.SV-set_Genomes/human_ref_sorted_format_filtered_sv.vcf \ -m Human_30x_24feature_RandomForest_model.joblib \ -s 04.validation-dataset/human/Human_SV_Set-sv_feature.tsv \ -a 04.validation-dataset/human/HG002_30x/BreakPoint_ReadDepth_2Bam_feature.tsv \ -p 04.validation-dataset/human/HG002_30x/para_feature.tsv \ -o HG002_30_svlearn_genotype.vcf \ -n HG002_30 svlearn benchmark \ -b 04.validation-dataset/human/Human_SV_Set-HG002_True_GT.vcf \ -c HG002_30_svlearn_genotype.vcf \ -o HG002_30_svlearn.bench.tsv \ -n1 HG002 -n2 HG002_30 ``` -------------------------------- ### Prepare Training Label File Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Format for the training label file, which should be tab-separated. It includes SV IDs and their ground truth labels. ```text sv_id GT_true INS.0 0/1 DEL.0 0/0 INS.1 1/1 ..... ..... ``` -------------------------------- ### Create Genotype Directory and Navigate Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md This command creates a new directory for genotyping results and changes the current directory into it. This is a prerequisite for running the genotyping commands. ```bash mkdir 06.genotype;cd 06.genotype ``` -------------------------------- ### Prepare Alt Genome with Filtering Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Command to prepare an alternative genome by filtering overlapping SVs. This is the default behavior and prepares files for subsequent analysis. ```bash svlearn prepareAlt --ref_fasta ref.fasta --ref_sv_vcf sv.vcf --out 01.prepareAlt_output ``` -------------------------------- ### Navigate Back to Parent Directory Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md After completing the genotyping process, this command changes the directory back to the parent directory. This is a common practice to return to the main project structure. ```bash cd .. ``` -------------------------------- ### Create and Activate Mamba Environment for SVLearn Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md This command uses mamba to create a new environment named 'svlearn' with the specified packages. Mamba is generally faster than conda for environment creation. Activate the environment after creation. ```bash mamba create -n svlearn python=3.9 bioconda::pysam=0.22.0 polars=0.20.15 pandas=2.2.1 scikit-learn=1.3.0 bioconda::pyfaidx pyarrow bioconda::pybedtools conda-forge::intervaltree mamba activate svlearn ``` -------------------------------- ### Generate Training Matrix with 18 Features Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Uses csvtk to join ground truth labels with feature files to create an 18-feature training matrix. This process is repeated for two sample sets. ```bash # 18 features csvtk join -t -f 'sv_id' training_sample1.true.gt.tsv sv_feature.tsv training_sample1.BreakPoint_ReadDepth_2Bam_feature.tsv > training_sample1.18feature.training.tsv csvtk join -t -f 'sv_id' training_sample2.true.gt.tsv sv_feature.tsv training_sample2.BreakPoint_ReadDepth_2Bam_feature.tsv > training_sample2.18feature.training.tsv csvtk concat training_sample1.18feature.training.tsv training_sample2.18feature.training.tsv > sample1_2.18feature.training.tsv ``` -------------------------------- ### Generate Training Matrix with 24 Features Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Uses csvtk to join ground truth labels with feature files, including additional 'para_feature.tsv', to create a 24-feature training matrix. This process is repeated for two sample sets. ```bash # 24 features csvtk join -t -f 'sv_id' training_sample1.true.gt.tsv sv_feature.tsv training_sample1.BreakPoint_ReadDepth_2Bam_feature.tsv training_sample1.para_feature.tsv > training_sample1.24feature.training.tsv csvtk join -t -f 'sv_id' training_sample2.true.gt.tsv sv_feature.tsv training_sample2.BreakPoint_ReadDepth_2Bam_feature.tsv training_sample2.para_feature.tsv > training_sample2.24feature.training.tsv csvtk concat training_sample1.24feature.training.tsv training_sample2.24feature.training.tsv > sample1_2.24feature.training.tsv ``` -------------------------------- ### Cattle Demo Benchmark Results Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Displays the performance metrics for the cattle SVLearn genotyping results compared to the truth set. Metrics like precision_GT and recall_GT focus on distinguishing heterozygous and homozygous genotypes. ```text sv_set_number 121435 genotyped_sv_number 120151 genotype_rate 0.9894 accuracy_genotyped_sv_number 115362 precision_GT 0.8619 recall_GT 0.7924 f1_GT 0.8257 precision 0.9104 recall 0.837 f1 0.8721 conc_00 0.9854 conc_01 0.7866 conc_11 0.8621 wgc 0.878 ``` -------------------------------- ### Run svlearn runParagraph Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Extracts paragraph features for SV sites from BAM files using the Paragraph tool. Requires reference and alternative FASTA, VCF, and BAM files. Outputs a TSV file with paragraph features. ```bash mkdir 05.para_feature;cd 05.para_feature svlearn runParagraph \ --ref_fasta ref.fasta \ --alt_fasta alt.fasta \ --ref_sv_vcf ../01.prepareAlt_output/ref_sorted_format_filtered_sv.vcf \ --alt_sv_vcf ../01.prepareAlt_output/alt_sorted_format_filtered_sv.vcf \ --ref_bam ../03.mapping/01.RefGenome/sample1.dedup.sort.bam \ --alt_bam ../03.mapping/02.AltGenome/sample1_alt.dedup.sort.bam \ --threads 20 \ --out sample1 cd .. ``` -------------------------------- ### Calculating Depth and Preparing Manifest for Paragraph Source: https://github.com/yangqimeng99/svlearn/wiki/Compare-with-other-tools Calculates sequencing depth for a sample using its BAM file and reference genome, then formats this information into a manifest file required by Paragraph for genotyping. ```bash # depth mkdir -p ./depth ./manifest idxdepth -b sample1.dedup.sort.bam -r ref.fasta -o ./depth/sample1.json --threads 16 echo -e "id\tpath\tdepth\tread length" > ./manifest/sample1.manifest.txt Depth_ReadsLength=$(awk '{match($0,/,"depth":([0-9]+\.[0-9]+)/,a);match($0, /"read_length":([0-9]+)/,b);print a[1]"\t"b[1]}' depth/sample1.json) echo -e "sample1\tsample1.dedup.sort.bam\t${Depth_ReadsLength}" >> ./manifest/sample1.manifest.txt ``` -------------------------------- ### Genotype and Benchmark SVs Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Commands to genotype structural variants using a trained model and then benchmark the results against a truth set. Ensure input file paths are correct for your environment. ```bash svlearn genotype \ -v 02.SV-set_Genomes/sheep_ref_sorted_format_filtered_sv.vcf \ -m Sheep_18feature_RandomForest_model.joblib \ -s 04.validation-dataset/sheep/Sheep_SV_Set-sv_feature.tsv \ -a 04.validation-dataset/sheep/Romanov_30x/BreakPoint_ReadDepth_2Bam_feature.tsv \ -o Romanov_30_svlearn_genotype.vcf \ -n Romanov_30 svlearn benchmark \ -b 04.validation-dataset/sheep/Sheep_SV_Set-Romanov_True_GT.vcf \ -c Romanov_30_svlearn_genotype.vcf \ -o Romanov_30_svlearn.bench.tsv \ -n1 Roman and -n2 Romanov_30 ``` -------------------------------- ### Train Model with 24 Features Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Trains a RandomForest model using the generated 24-feature training set, including 'paragraph' features. Specify the training set, model type, output file name, and number of threads. ```bash # 24 features svlearn trainingModel \ --train_set sample1_2.24feature.training.tsv \ --other_feature paragraph \ --train_model RandomForest \ --out RandomForest.24feature.model --threads 64 ``` -------------------------------- ### Run svlearn Genotype with 18-Feature Model Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md This command runs the svlearn genotype function using an 18-feature model. It requires reference SV VCF, a trained model, SV features, and alignment features. Use this when paragraph features have not been extracted. ```bash svlearn genotype \ --ref_sv_vcf ../01.prepareAlt_output/ref_sorted_format_filtered_sv.vcf \ --model model.joblib \ --sv_feature ../02.SV.feature/sv_feature.tsv \ --align_feature ../04.align_feature/sample1/BreakPoint_ReadDepth_2Bam_feature.tsv \ --name sample1 \ --out sample1_svlearn_18feature_genotype.vcf ``` -------------------------------- ### Train Model with 18 Features Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Trains a RandomForest model using the generated 18-feature training set. Specify the training set, model type, output file name, and number of threads. ```bash # 18 features svlearn trainingModel \ --train_set sample1_2.18feature.training.tsv \ --train_model RandomForest \ --out RandomForest.18feature.model --threads 64 ``` -------------------------------- ### Run svlearn Genotype with 24-Feature Model Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md This command runs the svlearn genotype function using a 24-feature model, which includes paragraph features. It requires all inputs from the 18-feature model plus the paragraph features. Use this when paragraph features have been extracted. ```bash svlearn genotype \ --ref_sv_vcf ../01.prepareAlt_output/ref_sorted_format_filtered_sv.vcf \ --model model.joblib \ --sv_feature ../02.SV.feature/sv_feature.tsv \ --align_feature ../04.align_feature/sample1/BreakPoint_ReadDepth_2Bam_feature.tsv \ --paragraph_feature ../05.para_feature/sample1/para_feature.tsv \ --name sample1 \ --out sample1_svlearn_24feature_genotype.vcf ``` -------------------------------- ### Prepare Alt Genome without Filtering Overlaps Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Command to prepare an alternative genome while retaining overlapping SVs. Use this option if you do not want to filter out overlapping SVs. ```bash svlearn prepareAlt --ref_fasta ref.fasta --ref_sv_vcf sv.vcf --out 01.prepareAlt_output --no-filter-overlaps ``` -------------------------------- ### Run svlearn alignFeature Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Extracts alignment features for SV sites from BAM files. Requires reference and alternative FASTA, VCF, BED, and BAM files. Outputs TSV files containing alignment features. ```bash mkdir 04.align_feature;cd 04.align_feature svlearn alignFeature \ --ref_fasta ref.fasta \ --alt_fasta alt.fasta \ --ref_sv_vcf ../01.prepareAlt_output/ref_sorted_format_filtered_sv.vcf \ --alt_sv_bed ../01.prepareAlt_output/alt_sorted_format_filtered_sv.bed \ --ref_bam ../03.mapping/01.RefGenome/sample1.dedup.sort.bam \ --alt_bam ../03.mapping/02.AltGenome/sample1_alt.dedup.sort.bam \ --threads 1 \ --out sample1 cd .. ``` -------------------------------- ### Prepare Alternative Insertion VCF Source: https://github.com/yangqimeng99/svlearn/wiki/Compare-with-other-tools Filters the alternative VCF for deletions (treated as insertions) and adds CIPOS/CIEND tags. This step aligns the alternative VCF to the reference VCF's format for SVTyper processing. ```bash bcftools view -i 'SVTYPE="DEL"' alt_sorted_format_filtered_sv.vcf | awk '{if($0 ~ /^#/) print $0; else print $0 ";CIPOS=-100,100;CIEND=-100,100"}' > alt_ins_ann.vcf ``` -------------------------------- ### Extract SV Features with svlearn Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Integrates features extracted by RepeatMasker, trf, GenMap, and BISER for SV analysis. Ensure all input files are correctly specified. ```bash mkdir 02.SV.feature; cd 02.SV.feature # 01.RepeatMasker, Please adjust the `-pa` and `-species` parameters based on the actual circumstances. RepeatMasker -pa 64 -engine ncbi -species human -xsmall -s -no_is -cutoff 255 -frag 20000 -dir ./ -gff ref.fasta RepeatMasker -pa 64 -engine ncbi -species human -xsmall -s -no_is -cutoff 255 -frag 20000 -dir ./ -gff alt.fasta # 02.trf trf ref.fasta 2 7 7 80 10 50 500 -f -d -h trf alt.fasta 2 7 7 80 10 50 500 -f -d -h python /software/svlearn/script/TRF2GFF.py -d ref.fasta.2.7.7.80.10.50.500.dat -o ref.trf.gff python /software/svlearn/script/TRF2GFF.py -d alt.fasta.2.7.7.80.10.50.500.dat -o alt.trf.gff # 03.GenMap bash /software/svlearn/script/genmap.sh ref.fasta ref.fasta.genmapK50E1 bash /software/svlearn/script/genmap.sh alt.fasta alt.fasta.genmapK50E1 # 04.BISER, ref.fasta.masked and alt.fasta.masked are the softmasked FASTA files obtained from the output of 01.RepeatMasker biser -o ref.fasta.masked.out -t 2 --gc-heap 32G ref.fasta.masked biser -o alt.fasta.masked.out -t 2 --gc-heap 32G alt.fasta.masked # 05.svlearn svFeature svlearn svFeature \ --ref_sv_vcf ../01.prepareAlt_output/ref_sorted_format_filtered_sv.vcf \ --alt_sv_bed ../01.prepareAlt_output/alt_sorted_format_filtered_sv.bed \ --ref_rm ref.fasta.out \ --alt_rm alt.fasta.out \ --ref_trf ref.trf.gff \ --alt_trf alt.trf.gff \ --ref_genmap ref.fasta.genmapK50E1.txt \ --alt_genmap alt.fasta.genmapK50E1.txt \ --ref_biser ref.fasta.masked.out \ --alt_biser alt.fasta.masked.out \ --out sv_feature.tsv cd .. ``` -------------------------------- ### Run SVTyper for Deletions and Insertions Source: https://github.com/yangqimeng99/svlearn/wiki/Compare-with-other-tools Executes SVTyper to genotype deletions using the reference BAM and insertions using the alternative BAM. This step generates VCF files with SVTyper's genotype calls for both deletion and insertion variants. ```bash svtyper -i ref_del_ann.vcf -B sample1.dedup.sort.bam -l sample1_ref.bam.json > sample1_svtyper_del.vcf ``` ```bash svtyper -i alt_ins_ann.vcf -B sample1_alt.dedup.sort.bam -l sample1_alt.bam.json > sample1_svtyper_ins.vcf ``` -------------------------------- ### Human Demo Benchmark Results Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Displays the performance metrics for the human SVLearn genotyping results compared to the truth set. Metrics like precision_GT and recall_GT focus on distinguishing heterozygous and homozygous genotypes. ```text sv_set_number 38613 genotyped_sv_number 37021 genotype_rate 0.9588 accuracy_genotyped_sv_number 32956 precision_GT 0.8292 recall_GT 0.7585 f1_GT 0.7922 precision 0.9209 recall 0.8424 f1 0.8799 conc_00 0.95 conc_01 0.7534 conc_11 0.8575 wgc 0.8537 ``` -------------------------------- ### Prepare Reference Deletion VCF Source: https://github.com/yangqimeng99/svlearn/wiki/Compare-with-other-tools Filters the reference VCF for deletions and adds CIPOS/CIEND tags. This prepares the VCF for SVTyper by ensuring only deletion variants are considered and standard confidence intervals are applied. ```bash bcftools view -i 'SVTYPE="DEL"' ref_sorted_format_filtered_sv.vcf | bcftools +fill-tags - -- -t END | awk '{if($0 ~ /^#/) print $0; else print $0 ";CIPOS=-100,100;CIEND=-100,100"}' > ref_del_ann.vcf ``` -------------------------------- ### Generating Bloom Filter for BayesTyper Source: https://github.com/yangqimeng99/svlearn/wiki/Compare-with-other-tools Creates a Bloom filter using BayesTyper tools, which is used for efficient variant querying. This step requires the k-mer count output from KMC3. ```bash bayesTyperTools makeBloom -k sample1 -p 16 ``` -------------------------------- ### KMC3 K-mer Counting for BayesTyper Source: https://github.com/yangqimeng99/svlearn/wiki/Compare-with-other-tools Counts k-mers from a sample's BAM file using KMC3, which is a preliminary step for BayesTyper. The output is stored in a specified temporary directory. ```bash #before bayestyper, using KMC3 to Count k-mers. mkdir -p ./kmc_tmp kmc -k55 -ci1 -fbam sample1.dedup.sort.bam sample1 ./kmc_tmp ``` -------------------------------- ### Genotyping with Paragraph Source: https://github.com/yangqimeng99/svlearn/wiki/Compare-with-other-tools Performs structural variant genotyping using the Paragraph tool. It requires a manifest file with depth information and a set of SVs in VCF format. ```bash Depth=`cut -f3 ./manifest/sample1.manifest.txt | tail -1` maxDepth=`echo 20*${Depth}/1 | bc` #genotype mkdir -p tmp multigrmpy.py \ -i ref_sorted_format_filtered_sv.vcf \ -M ${maxDepth} \ -m ./manifest/sample1.manifest.txt \ -r ref.fasta \ -t 16 -o sample1 --scratch-dir tmp ``` -------------------------------- ### Genotyping with BayesTyper Source: https://github.com/yangqimeng99/svlearn/wiki/Compare-with-other-tools Performs variant genotyping for each unit using BayesTyper. This command requires variant cluster data, sample information, reference genomes, and output parameters. ```bash # genotyping (${i}=1、2...n) bayesTyper genotype -r 10 -v bayestyper_unit_${i}/variant_clusters.bin -c bayestyper_cluster_data -s sample.tsv -g ref.canon.fasta -d ref.decoy.fasta -o bayestyper_unit_${i}/bayestyper -z -p 16 ``` -------------------------------- ### Construct Final Genotype VCF Source: https://github.com/yangqimeng99/svlearn/wiki/Compare-with-other-tools Builds the final VCF file containing combined genotype information. This includes header information and joins the genotype data with variant details from the reference VCF. ```bash bcftools view ref.vcf | grep '##' > sample1_svtyper_sv.gt.vcf ``` ```bash echo -e "##FORMAT=" >> sample1_svtyper_sv.gt.vcf ``` ```bash echo -e "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\tsvtyper_GT" >> sample1_svtyper_sv.gt.vcf ``` ```bash bcftools view ref_sorted_format_filtered_sv.vcf | grep -v '#' | awk '{print $0"\tGT"}' | csvtk join -t -H -f '3;1' - sample1_svtyper_sv.gt.tsv >> sample1_svtyper_sv.gt.vcf ``` -------------------------------- ### Genotyping Structural Variants with GraphTyper2 Source: https://github.com/yangqimeng99/svlearn/wiki/Compare-with-other-tools Executes GraphTyper2 for genotyping structural variants. It requires the reference genome, an SV VCF file, a BAM file, and a file specifying genomic regions for genotyping. ```bash graphtyper genotype_sv ref.fasta ref_sorted_format_filtered_sv.vcf.gz \ --sam=sample1.dedup.sort.bam \ --region_file=genotyping_sv.region \ --output=sample1 \ --threads=16 bcftools concat -a ./sample1/*/*.vcf.gz -O z -o sample1_graphtyper.vcf.gz ``` -------------------------------- ### Indexing Reference Genome with BWA-MEM2 Source: https://github.com/yangqimeng99/svlearn/wiki/Compare-with-other-tools Indexes the reference genome FASTA file for use with BWA-MEM2 aligner. This is a prerequisite for mapping reads. ```bash bwa-mem2.avx512bw index ref.fasta ``` -------------------------------- ### Extract and Format Genotypes Source: https://github.com/yangqimeng99/svlearn/wiki/Compare-with-other-tools Queries the genotype information from the SVTyper output VCFs and combines them into a single TSV file. It also inverts genotypes for insertions to match the reference genome's perspective. ```bash bcftools query -f '%ID\t[%GT]\n' sample1_svtyper_del.vcf > sample1_svtyper_sv.gt.tsv ``` ```bash bcftools query -f '%ID\t[%GT]\n' sample1_svtyper_ins.vcf | awk '{if ($2=="0/0") {print $1"\t1/1"} else if ($2=="1/1") {print $1"\t0/0"} else {print $0}}' >> sample1_svtyper_sv.gt.tsv ``` -------------------------------- ### Map Reads to Reference Genome with BWA-MEM2 Source: https://github.com/yangqimeng99/svlearn/blob/main/README.md Performs read mapping of sample short reads to the reference FASTA file using BWA-MEM2 and a helper script for deduplication and sorting. This process is repeated for the alternative genome. ```bash # Reads mapping, only one sample is shown as an example, but multiple samples can be mapped in parallel cd 01.RefGenome bash /software/svlearn/script/bwa_dedup.sh sample1_R1.fastq.gz sample1_R2.fastq.gz ref.fasta sample1 cd ../02.AltGenome bash /software/svlearn/script/bwa_dedup.sh sample1_R1.fastq.gz sample1_R2.fastq.gz alt.fasta sample1_alt cd ../.. ``` -------------------------------- ### Variant Clustering with BayesTyper Source: https://github.com/yangqimeng99/svlearn/wiki/Compare-with-other-tools Identifies variant clusters using BayesTyper. This command requires the reference genome (canonical and decoy), an SV VCF file, a sample TSV file, and the number of threads. ```bash #Identifying variant clusters bayesTyper cluster -r 10 -v ref_sorted_format_filtered_sv.vcf.gz -s sample.tsv -g ref.canon.fasta -d ref.decoy.fasta -p 16 ``` -------------------------------- ### Mapping Reads with BWA-MEM2 and Deduplication Source: https://github.com/yangqimeng99/svlearn/wiki/Compare-with-other-tools Maps short reads to the reference genome using BWA-MEM2 and performs deduplication. This script generates a sorted and deduplicated BAM file. ```bash # Reads mapping bash /software/svlearn/script/bwa_dedup.sh sample1_R1.fastq.gz sample1_R2.fastq.gz ref.fasta sample1 # output BAM: sample1.dedup.sort.bam ``` -------------------------------- ### Merging BayesTyper Genotyping Results Source: https://github.com/yangqimeng99/svlearn/wiki/Compare-with-other-tools Concatenates the VCF files generated by BayesTyper for each unit into a single VCF file. This command uses bcftools to merge the results. ```bash #merge bcftools concat -a -o sample1_bayestyper.vcf.gz bayestyper_unit_*/bayestyper.vcf.gz ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.