Hello,
How can I use Rsamtools
, so I can import the results from a bam file? E.g. if I use samtools view sample.bam > sample.sam
, I can import this sam file easily into R. However, if I run Rsamtools
, and do something like
input_bam <- "sample.bam"
output_sam <- "sample"
sam <- asSam(input_bam, destination = output_sam)
sample <- read.delim(output_sam, header=FALSE)
The imported data looks quite different, the latter one has a log of unaligned entries.
what do you mean by a "log of unaligned entries"?
The top sam file has been created with samtools view, and I can easily import it into R. The second has been done with
asSAM
, it does not properly load into R.