rkk has asked for the wisdom of the Perl Monks concerning the following question:
Hello, I am using BIO::DB::SAM perl module to parse binary file. Here is my code.
#!/usr/bin/perl use strict; use Bio::DB::Sam; open (OUTPUT1,">op_info.txt") || die "can't: $!"; my $bam = Bio::DB::Bam->open('input.bam'); my $header = $bam->header; my $target_count = $header->n_targets; my $target_names = $header->target_name; while (my $align = $bam->read1) { print OUTPUT1 "$align\n"; } output: Bio::DB::Bam::Alignment=SCALAR(0x7fe4d0b194d8) Bio::DB::Bam::Alignment=SCALAR(0x7fe4d0b194c0) Bio::DB::Bam::Alignment=SCALAR(0x7fe4d0b194d8) Bio::DB::Bam::Alignment=SCALAR(0x7fe4d0b194c0) Bio::DB::Bam::Alignment=SCALAR(0x7fe4d0b194d8) Bio::DB::Bam::Alignment=SCALAR(0x7fe4d0b194c0) Bio::DB::Bam::Alignment=SCALAR(0x7fe4d0b194d8) Bio::DB::Bam::Alignment=SCALAR(0x7fe4d0b194c0) Bio::DB::Bam::Alignment=SCALAR(0x7fe4d0b194d8)
How to dereference the variable and print the contents of the file.
Thanks in advance.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: De referencing
by poj (Abbot) on Jun 22, 2013 at 07:01 UTC | |
|
Re: De referencing
by davido (Cardinal) on Jun 22, 2013 at 06:00 UTC | |
|
Re: De referencing
by aitap (Curate) on Jun 22, 2013 at 07:00 UTC | |
|
Re: De referencing
by locked_user sundialsvc4 (Abbot) on Jun 22, 2013 at 22:25 UTC | |
by Anonymous Monk on Jan 19, 2014 at 16:20 UTC | |
by Anonymous Monk on Jan 19, 2014 at 16:34 UTC |