Downloading BAM files and converting to fastq
1
0
Entering edit mode
5.9 years ago
lamia_203 ▴ 100

I'm trying to download fastq files and managed fine before. However, for one study the samples are saved as BAM files. Is it possible to still download the BAM files and convert them to fastq files? What took can I use for the conversion if so?

The study is on ebi https://www.ebi.ac.uk/ena/data/view/PRJNA470834

RNA-Seq fastq BAM EBI • 1.8k views
ADD COMMENT
2
Entering edit mode
5.9 years ago

For sure, see the bamtofastq tool from bedtools:

https://bedtools.readthedocs.io/en/latest/content/tools/bamtofastq.html

$ bedtools bamtofastq -i NA18152.bam -fq NA18152.fq

To get paired-end fastq files (requires sorting):

$ samtools sort -n aln.bam aln.qsort

$ bedtools bamtofastq -i aln.qsort.bam \
                      -fq aln.end1.fq \
                      -fq2 aln.end2.fq

Also, it seems like your dataset has an SRP under secondary accession (SRP145274), so presumably you should be able to get the fastq files from SRA.

Example: GSM3138950 from this project has the following sequencing run: SRR7142657

And the .sra file from the SRA FTP server:
https://ftp-trace.ncbi.nih.gov/sra/sra-instant/reads/ByRun/sra/SRR/SRR714/SRR7142657/

You can extract fastq files from .sra files using fastq-dump.

ADD COMMENT
1
Entering edit mode

Thank you! This seems to work.

ADD REPLY
0
Entering edit mode

lamia_203 : Don't forget to follow up on your threads.

If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one if they work.
Upvote|Bookmark|Accept

ADD REPLY

Login before adding your answer.

Traffic: 1667 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6