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.
In reply to De referencing by rkk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |