Commit 2d25e5ae authored by Marwan ELKREWI's avatar Marwan ELKREWI
Browse files

Update SNP_calling_in_backcrossing_experiment.md

parent 960ab4d7
## Important Details:
Samples 16-20 are asexuals, 21-30 are putative sexuals.
The same parameters were run for asexuals and sexuals, unless stated otherwise.
Steps 1-5 are processing for all analyses.
Steps 6-9 are the processing for the Pooled Analysis (Popoolation) used in the main text.
Steps 10-11 Pipeline for individual-based analyses - produces the raw VCF for downstream analysis in the supplement.
Steps 1-6 are processing for all analyses.
Steps 7-10 are the processing for the Pooled Analysis (Popoolation) used in the main text.
Steps 11-12 Pipeline for individual-based analyses - produces the raw VCF for downstream analysis in the supplement.
# Subset reads for the pooled analysis
### 1. Subset reads for the pooled analysis
Let's make sure we start with the same number of reads per female in each pool (asexuals and controls).
......@@ -84,29 +84,29 @@ grep '@A00' asex1_sub.fq1 | perl -pi -e 's/\/[12]//gi' | md5sum
```
### 1. Trimming
### 2. Trimming
```
java -jar trimmomatic-0.39.jar PE sample.1.fq sample.2.fq sample.1.paired.fq sample.1.unpaired.fq sample.2.paired.fq sample.2.unpaired.fq ILLUMINACLIP:TruSeq3-PE-2.fa:2:30:10:2:keepBothReads LEADING:3 TRAILING:3 MINLEN:36
```
### 2. Indexing the genome
### 3. Indexing the genome
```
module load bowtie2/2.4.4
bowtie2-build Artemia_sinica_genome_29_12_2021.fasta Sinica.index
```
### 3. Align Reads
### 4. Align Reads
```
module load bowtie2/2.4.4
bowtie2 --local --sensitive --no-unal -p 8 -x Sinica.index -1 sample.1.paired.fq -2 sample.2.paired.fq -S sample.sam
```
### 4. Convert sam to bam
### 5. Convert sam to bam
```
module load samtools/1.13
samtools view -bS sample.sam > sample.bam
```
### 5. Sort bam
### 6. Sort bam
```
samtools sort -@ 8 sample.bam > sample.sort.bam
```
......@@ -114,18 +114,18 @@ samtools sort -@ 8 sample.bam > sample.sort.bam
## Pooled Analyses
### 6. Merge bamfiles into sex and asex bamfiles
### 7. Merge bamfiles into sex and asex bamfiles
```
samtools merge Sex.bam sample21.sort.bam sample22.sort.bam sample23.sort.bam sample24.sort.bam sample25.sort.bam sample26.sort.bam sample27.sort.bam sample28.sort.bam sample29.sort.bam sample30.sort.bam
samtools merge Asex.bam sample16.sort.bam sample17.sort.bam sample18.sort.bam sample19.sort.bam sample20.sort.bam
samtools view -q 20 -@ 8 -bS Asex.bam | samtools sort > Asex.sort.bam
samtools view -q 20 -@ 8 -bS Sex.bam | samtools sort > Sex.sort.bam
```
### 7. Make pileup
### 8. Make pileup
```
samtools mpileup -B Asex.sort.bam Sex.sort.bam > Asex_Sex.mpileup
```
### 8. Run Popoolation
### 9. Run Popoolation
```
java -ea -Xmx7g -jar Popoolation2/popoolation2_1201/mpileup2sync.jar --input Asex_Sex.mpileup --output Asex_Sex_java.sync --fastq-type sanger --min-qual 20 --threads 2
perl Popoolation2/popoolation2_1201/snp-frequency-diff.pl --input Asex_Sex_java.sync --output-prefix Asex_Sex --min-count 6 --min-coverage 50 --max-coverage 200
......@@ -139,7 +139,7 @@ per 1kb
perl Popoolation2/popoolation2_1201/fst-sliding.pl --input Asex_Sex_java.sync --output Asex_Sex.1kb.fst --suppress-noninformative --min-count 2 --min-coverage 50 --max-coverage 1000 --min-covered-fraction 1 --window-size 1000 --step-size 1000 --pool-size 5:10
```
### 9. R Script to make figures
### 10. R Script to make figures
[FST.LG.1kb.AsexSex.Popoolation.R](https://git.ist.ac.at/bvicoso/zsexasex2021/-/blob/master/FST.LG.1kb.AsexSex.Popoolation.R)
infile2 = Asex_Sex.persnp.fst.modified.input.txt (FST per SNP)
......@@ -148,15 +148,15 @@ infile1 = Asex_Sex.1kb.try3.fst.modifiedinput.txt (FST per 1kb)
## Individual-based analyses
### 10. Make pileup for indvidual-based analyses
### 11. Make pileup for indvidual-based analyses
```
samtools index Artemia_sinica_genome_29_12_2021.fasta
samtools mpileup -B -d 10000000 -f Artemia_sinica_genome_29_12_2021.fasta -b Asex.Sex.bamfilelist.txt > Asex.Sex.sample.pileup
```
### 11. Build vcf (raw) for downstream supplemental analyses
### 12. Build vcf (raw) for downstream supplemental analyses
```
java -jar VarScan.v2.4.3.jar mpileup2snp Asex.Sex.sample.pileup --min-coverage 5 --min-avg-qual 20 --strand-filter 1 --p-value 0.05 --min-var-freq 0.15 --min-freq-for-hom 0.85 --min-reads2 3 --output-vcf > Asex.Sex.vcf
java -jar VarScan.v2.4.3.jar mpileup2cns Asex.Sex.sample.pileup --min-coverage 5 --min-avg-qual 20 --strand-filter 1 --p-value 0.05 --min-var-freq 0.15 --min-freq-for-hom 0.85 --min-reads2 3 --output-vcf > Asex.Sex.cns
java -jar VarScan.v2.4.3.jar mpileup2snp Asex.Sex.sample.pileup --min-coverage 10 --min-avg-qual 20 --strand-filter 1 --p-value 0.05 --min-var-freq 0.15 --min-freq-for-hom 0.85 --min-reads2 3 --output-vcf > Asex.Sex.vcf
java -jar VarScan.v2.4.3.jar mpileup2cns Asex.Sex.sample.pileup --min-coverage 10 --min-avg-qual 20 --strand-filter 1 --p-value 0.05 --min-var-freq 0.15 --min-freq-for-hom 0.85 --min-reads2 3 --output-vcf > Asex.Sex.cns
```
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment