demianriccardi / p5-HackaMol

Object-Oriented Perl 5, Moose Library for Molecular Hacking
Other
12 stars 6 forks source link

adjust api for printing #48

Closed dmr3 closed 6 years ago

dmr3 commented 6 years ago

currently, print_pdb, xyz, etc. will either print to the screen or to a file handle. A better approach would be to return a string (or lines or an iterator) that the user can decide where the output should go.

a string could then be used for easy clones (not really clone, but gens of similar objects) via reading in strings.

Perhaps adding the new method would be a good start:

form_string('pdb', [xyz .. etc])
demianriccardi commented 6 years ago

done


print $group->pdb_string
# easy 'cloning'
my $new_group = $bldr->read_string_mol( $group->string_pdb, 'pdb');