Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: De referencing

by sundialsvc4 (Abbot)
on Jun 22, 2013 at 22:25 UTC ( #1040297=note: print w/ replies, xml ) Need Help??

in reply to De referencing

One good tool for sorting this sort of thing out, in a general sense, is Data::Dumper, which is good at printing-out any ol’ thing so that you can see what it is.   Once you can see it, you can probably see your way clear (along with taking a good re-look at the documentation) as to how to properly de-reference it and use it.

use Data::Dumper;
print STDERR Data::Dumper->Dump([ $align ], [ 'align' ]);

The STDERR (“standard error-output”) stream is a traditional place to send error-messages and “chatty” in-progress status messages.   It normally maps to the terminal, or, in the case of Apache, to the error-log.

In this case, though, the documentation example for Bio::DB::Sam ought to be sufficient.   In their example, read1 clearly returns an object ... and the documentation obliquely says (without actually saying), that this object is a Bio::DB::Bam::Alignment object, which is separately documented in CPAN.   When the documentation does not go that far, Data::Dumper will usually give you the important-clue by having identified the object class-name that a particular variable has been bless()ed into.   A search for that class-name on CPAN, more often than not, will be fruitful.

Comment on Re: De referencing
Replies are listed 'Best First'.
Re^2: De referencing
by Anonymous Monk on Jan 19, 2014 at 16:20 UTC
    How do you complete align record. For instance I would like to print all the align record as it is in sam file if it satisfies a particular condition.
      YEs I kind of have same to print complete record

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1040297]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2015-12-02 00:15 GMT
Find Nodes?
    Voting Booth?

    My keyboard shows this many letters:

    Results (31 votes), past polls