Skip to content

Instantly share code, notes, and snippets.

@sestaton
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sestaton/09781a5ac8849753d6ed to your computer and use it in GitHub Desktop.
Save sestaton/09781a5ac8849753d6ed to your computer and use it in GitHub Desktop.
trim sra files and repair the reads
#!/bin/bash
## fetch the archive
wget ftp://ftp-trace.ncbi.nih.gov/sra/sra-instant/reads/ByRun/sra/SRR/SRR156/SRR1561197/SRR1561197.sra
## extract the pairs
fastq-dump -F --split-files ./SRR1561197.sra
## trim
fastq_quality_filter -i SRR1561197_1.fastq -q 28 -p 100 -Q33 -o SRR1561197_1_filt.fastq
fastq_quality_filter -i SRR1561197_2.fastq -q 28 -p 100 -Q33 -o SRR1561197_2_filt.fastq
## add pair info to reads and remove comment to reduce size
curl -sL git.io/pairfq_lite | perl - addinfo -i SRR1561197_1_filt.fastq -o SRR1561197_1_filt_info.fastq -p 1
curl -sL git.io/pairfq_lite | perl - addinfo -i SRR1561197_2_filt.fastq -o SRR1561197_2_filt_info.fastq -p 2
## pair the reads
time curl -sL git.io/pairfq_lite | perl - makepairs -f SRR1561197_1_filt_info.fastq \
-r SRR1561197_2_filt_info.fastq \
-fp SRR1561197_1_filt_info_p.fastq \
-rp SRR1561197_2_filt_info_p.fastq \
-fs SRR1561197_1_filt_info_s.fastq \
-rs SRR1561197_2_filt_info_s.fastq \
--stats
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment