Question: Downloading BAM files and converting to fastq
0
gravatar for lamia_203
4 weeks ago by
lamia_20330
lamia_20330 wrote:

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 bam fastq ebi • 171 views
ADD COMMENTlink modified 4 weeks ago by manuel.belmadani470 • written 4 weeks ago by lamia_20330
2
gravatar for manuel.belmadani
4 weeks ago by
Canada
manuel.belmadani470 wrote:

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 COMMENTlink modified 4 weeks ago • written 4 weeks ago by manuel.belmadani470
1

Thank you! This seems to work.

ADD REPLYlink written 4 weeks ago by lamia_20330

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 REPLYlink modified 4 weeks ago • written 4 weeks ago by genomax62k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1916 users visited in the last hour