SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
extracting reads from sam/bam file gene wise chris_bioinfo Bioinformatics 5 09-20-2013 03:09 AM
Filter paired & mapped reads from SAM/BAM file pirates.genome Bioinformatics 2 06-19-2012 02:21 AM
GATK: unable to write data to BAM schedule file bjchen Bioinformatics 5 02-13-2012 01:21 AM
Re-write strand information in BAM file droog_22 Bioinformatics 1 11-07-2011 04:25 AM
Extract perfectly mapped reads from SAM/BAM file Graham Etherington Bioinformatics 2 07-21-2011 08:27 AM

Reply
 
Thread Tools
Old 01-27-2016, 05:41 AM   #1
Old Pioneer
Junior Member
 
Location: Belarus, Minsk

Join Date: Jan 2016
Posts: 1
Default Write the subset of reads from BAM file into new SAM/BAM file, using R tools.

Hello every one.

I am new in bioinformatic, and now I try solve the next problem. I have sorted BAM file with paired-end RNA-Seq data (several tens of thousands reads). My work tool is R. I need: 1) Filter this file by "isize" field: extract the reads with isize not equal to NA and with absolute value of isize lower than threshold (in this case, 642 bp); 2) Write this subset into SAM file, because this type is required for package which I will use.

I tried use R package Rsamtools for this, function filterBam(). Remove reads with isize == NA is possible by means scanBamFlag:
flag <- scanBamFlag(isPaired = TRUE, hasUnmappedMate = FALSE).

But I have no idea about filtration by threshold (abs(bamFile$isize) <= 642). How I can do it in R? I do not believe that effective way for this does not exist. Unfortunately, my experience in R and programming for now is inadequate for solve this problem quickly. Can someone to help me? Thanks in advance!
Old Pioneer is offline   Reply With Quote
Reply

Tags
bioinformatics, r language, rna seq

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 07:34 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO