Hi everyone, I' m trying to convert sra file from ncbi to bam with this command:
sam-dump SRRfile | samtools view -bS - > SRRfile.bam
and I get this error :
2019-12-06T10:22:54 sam-dump.2.9.0 int: transfer incomplete while reading file within network system module - VCursorCellDataDirect( row#56918017 . idx#6 . READ ) INSDC_dna_text (ptr) failed [W::sam_read1] Parse error at line 56918017 [main_samview] truncated file.
Does anyone know what is the problem here?Can someone help me? Thanks
1 answer
It is not recommended to directly dump files, be it fastq or sam from NCBI. The connection is too unstable (in my experience) and this is exactly what you see. This file is most likely also raw (unaligned) data so there is little point in transformating it to BAM. Better get raw data and align yourself, see for download strategies:
Fast download of FASTQ files from the European Nucleotide Archive (ENA)
It includes downloading fastq files from ENA (which mirrors NCBI) or using the SRAtoolkit (prefetch/fastq-dump).
Log in to answer this question.
thanks, I solved this problem using 'prefetch'.