Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix parser so that it only reads frequencies up to the number expecte…

…d, the rest of the line is comment I assume (and is dropped)

svn path=/bioperl-pedigree/trunk/; revision=12112
  • Loading branch information...
commit 0b39eab7a4862a223ea30cf8e3a5c298eff379e3 1 parent 169cfd4
@hyphaltip hyphaltip authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 Bio/Pedigree/PedIO/ped.pm
View
4 Bio/Pedigree/PedIO/ped.pm
@@ -121,7 +121,7 @@ sub read_pedigree{
$line =~ s/\#//g;
#name may be undefined. assign it the marker id number if
#we don't have it.
- my($type,$alleles, $name) = split(/\s+/,$line);
+ my($type,$num_alleles, $name) = split(/\s+/,$line);
$name ||= $_;
# $name =~ s/\#//;
my $marker;
@@ -150,8 +150,8 @@ sub read_pedigree{
$line = $fh->_readline;
$line =~ s/^\s+(\S+)/$1/;
my( $count,%alleles) = ( 1 );
-
foreach my $freq ( split(/\s+/,$line) ) {
+ last if $count >= $num_alleles;
$alleles{$count++} = $freq;
}
Please sign in to comment.
Something went wrong with that request. Please try again.