Thank you! This seems to work.
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
1 answer
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.
Log in to answer this question.
