I downloaded SRA file and converted it to SAM file:
sam-dump -1 SRR6040553 > SRR6040553.sam
and after to BAM file:
samtools view -S -b -T GRCh38_latest_genomic.fna SRR6040553.sam > SRR6040553.bam
But NIPTeR cannot read it file:
NIPTsample <- bin_bam_sample("SRR6040553.bam", do_sort = FALSE, separate_strands = F, custom_name = NULL)
The error is:
Error in splitted_reads[[1]] : subscript out of bounds
Thank you in advance!
1 answer
What you downloaded are raw data in SAM format and contains no positional information. You have to align them first prior to any downstream analysis. Get the fastq files e.g. with this tutorial Fast download of FASTQ files from the European Nucleotide Archive (ENA) or use samtools fastq to get fastq from that SAM file and then use an aligner of choice, e.g. bwa, bowtie2, hisat2 for alignment. I guess the error here is that the script tries to access the first of the bins via [[1]] but as there are no positional records (and by this no bin counts at all) there is this out-of-bounds error.
Log in to answer this question.