Entering edit mode
8.3 years ago
Deepak Tanwar
★
4.2k
Hello everyone,
I would like to create some small test fastq files and small reference genomes to test my pipeline.
What I have?
Few bam files.
What I want?
Short
fastqfiles from mybam files.Short
reference genometo align thosefastqfiles.
For the conversion of BAM to FASTQ, you can use Bamtools: bedtools bamtofastq [OPTIONS] -i <bam> -fq <fastq> (you can check the documentation http://bedtools.readthedocs.io/en/latest/content/tools/bamtofastq.html).
To make a reference genome you can get the consensus sequence of your reads using Samtools. It is going to be something like this: samtools mpileup -uf ref.fa aln.bam | bcftools call -c | vcfutils.pl vcf2fq > cns.fq (based on http://www.htslib.org/doc/samtools.html).
If you need a smaller genome in general to align your reads against to it, you can get a subsequent of the genome of your interest.
samtools fastqwill do the fastq conversion, if you want to stay all withinsamtools.Between
reformat.sh(to get the fastq) andtadpole.sh(to assemble those into a reference) BBMap Suite may have you covered.