hello I have a strong headache with a task. The issue is that I wan to calculate RPM based on metatranscriptome read matches against its own Metagenome to search specific gene expression levels.
For that purpose performed an alignment with bowtie2 (aligning the metatranscriptomic reads against metagenomic contigs) and I obtained a bam file.
With that bam file I want to use bam2rpm function of "intePareto" R package to calculate the RPM for each gene of interest.
Previously I have mapped the genes of interest against the metagneomic contigs using mmseqs2 and I obtained a blastn table (output format 6: https://www.metagenomics.wiki/tools/blast/blastn-output-format-6)
Reading the documentation of bam2rpm()
function, I need to build a GRanges object with the GRanges()
function.
The problem is that last function: one of the needed parameters is the strand to look for when constructing the GRanges object per each contain and it should be added as input on the following manner:
gr1 <- GRanges(seqnames=Rle(c("ch1", "chMT"), c(2, 4)),
ranges=IRanges(16:21, 20), strand=rep(c("+", "-", "*"), 2))
on the above code, the strand
parameter ins asking for the strand to look for. To adores that, how do I know at which strand the program should look for per each contig? how can I retrieve that information? from the bam file? if so, how?
Thanks for your time :)