[Bioperl-l] reading sam files
Jonas Zierer
jonas.zierer at campus.lmu.de
Wed Jun 15 08:50:15 UTC 2011
Hi,
the reason is, that i want do add tags to the sam file. as far as i know
this is only possible in sam files and not in bam files. now i have to
read the sam file analyze the read and add the tag. These tags are
written to the sam file which can then be converted to bam.
If i have to read a bam file with bioperl i have to convert the sam to
bam, read it with bioperl, change the sam file and convert it again.
my target was to avoid this second conversion, but i think that's the
best solution.
thx for your help!
bye
Am Tuesday, den 14.06.2011, 12:26 -0500 schrieb Chris Fields:
> Jonas,
>
> I think you need TAM (aka text-based SAM, which I think most users call SAM output). It does handle that, look here:
>
> http://search.cpan.org/~lds/Bio-SamTools-1.28/lib/Bio/DB/Sam.pm#TAM_Files
>
> I'm not sure why you would want to do this though, as the BAM file can be manipulated directly as well (would think it is faster working with BAM). Any reason you are doing this?
>
> chris
>
> On Jun 14, 2011, at 9:29 AM, Scott Cain wrote:
>
> > Hi Jonas,
> >
> > Then I think you are correct that there isn't a way to read sam files
> > directly. You could convert to bam, or extend Bio::DB::Sam to do what
> > you want (patches welcome!).
> >
> > Scott
> >
> >
> > On Tue, Jun 14, 2011 at 7:47 AM, Jonas Zierer
> > <jonas.zierer at campus.lmu.de> wrote:
> >> Hi Scott,
> >>
> >> no, i didn't find any way to read sam files in the documentation
> >> (http://cpan.uwinnipeg.ca/htdocs/Bio-SamTools/Bio/DB/Sam.html )
> >>
> >> the BIO::DB::Sam->new method only takes a -bam argument and give a sam
> >> file to this method it says
> >> [bam_header_read] EOF marker is
> >> absent.
> >> [bam_index_load] fail to load BAM
> >> index.
> >> [bam_header_read] EOF marker is
> >> absent.
> >> [bam_header_read] EOF marker is absent.
> >>
> >> Jonas
> >>
> >>
> >> Am Monday, den 13.06.2011, 12:39 -0400 schrieb Scott Cain:
> >>> Hello Jonas,
> >>>
> >>> When you say it didn't work, what do you mean? Did you read the
> >>> documentation, and it didn't work the way the documentation indicated?
> >>> Could you show the code you used and any error messages you got?
> >>>
> >>> Scott
> >>>
> >>>
> >>> On Wed, Jun 8, 2011 at 9:10 AM, Jonas Zierer <jonas.zierer at campus.lmu.de> wrote:
> >>>> Hi,
> >>>>
> >>>> i tried to read a sam file insted of a bam file using DB::BIO::Sam, but
> >>>> that didn't work.
> >>>>
> >>>> Is there any other possibility to read sam files with bioperl?
> >>>>
> >>>> thx, bye
> >>>>
> >>>> _______________________________________________
> >>>> Bioperl-l mailing list
> >>>> Bioperl-l at lists.open-bio.org
> >>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> >>>>
> >>>
> >>>
> >>>
> >>
> >>
> >>
> >
> >
> >
> > --
> > ------------------------------------------------------------------------
> > Scott Cain, Ph. D. scott at scottcain dot net
> > GMOD Coordinator (http://gmod.org/) 216-392-3087
> > Ontario Institute for Cancer Research
> >
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at lists.open-bio.org
> > http://lists.open-bio.org/mailman/listinfo/bioperl-l
>
More information about the Bioperl-l
mailing list