Bio-Polloc

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

	--version
	--wordexp
Shell options:
	-irsD or -c command or -O shopt_option		(invocation only)
	-abefhkmnptuvxBCHP or -o option

--------------------- WARNING ---------------------
MSG: Muscle call crashed: 512 [command  -in /tmp/_YS2FojZj7  -out /tmp/7BP7tE2dKG/fwsAmEh1NG 2> /dev/null]

---------------------------------------------------
Can't call method "average_percentage_identity" on an undefined value at /Users/luismrodriguezr/.cpan/build/Bio::Polloc-1.0503-xA5_RC/blib/lib/Bio/Polloc/LociGroup.pm line 376.
# Looks like you planned 13 tests but ran 6.
# Looks like your test exited with 2 just after 6.
t/05-typing/02-typing.t ............ Dubious, test returned 2 (wstat 512, 0x200)
Failed 7/13 subtests 
```

This very verbose message often means one thing: you have `Bio::Tools::Run::Alignment::Muscle` installed in
your system, but you don't have Muscle.  The solution is pretty easy: install muscle, available at
[Robert Edgar's website](http://www.drive5.com/muscle/downloads.htm).

README.txt  view on Meta::CPAN

	--version
	--wordexp
Shell options:
	-irsD or -c command or -O shopt_option		(invocation only)
	-abefhkmnptuvxBCHP or -o option

--------------------- WARNING ---------------------
MSG: Muscle call crashed: 512 [command  -in /tmp/_YS2FojZj7  -out /tmp/7BP7tE2dKG/fwsAmEh1NG 2> /dev/null]

---------------------------------------------------
Can't call method "average_percentage_identity" on an undefined value at /Users/luismrodriguezr/.cpan/build/Bio::Polloc-1.0503-xA5_RC/blib/lib/Bio/Polloc/LociGroup.pm line 376.
# Looks like you planned 13 tests but ran 6.
# Looks like your test exited with 2 just after 6.
t/05-typing/02-typing.t ............ Dubious, test returned 2 (wstat 512, 0x200)
Failed 7/13 subtests 
```

This very verbose message often means one thing: you have `Bio::Tools::Run::Alignment::Muscle` installed in
your system, but you don't have Muscle.  The solution is pretty easy: install muscle, available at
[Robert Edgar's website](http://www.drive5.com/muscle/downloads.htm).

lib/Bio/Polloc/GroupCriteria.pm  view on Meta::CPAN

sequences).

=back

=item -score I<int>

Minimum score for either algorithms B<blast> and B<hmmer>. 20 by default.

=item -consensusperc I<float>

Minimum percentage a residue must appear in order to include it in the
consensus used as query.  60 by default.  Only if -algorithm blast.

=item -e I<float>

If C<-algorithm> B<blast>, maximum e-value.  0.1 by default.

=item -p I<str>

If C<-algorithm> B<blast>, program used (C<[t]blast[npx]>).  B<blastn> by
default.

lib/Bio/Polloc/GroupCriteria/operator/num.pm  view on Meta::CPAN

      my $factory = Bio::Tools::Run::Alignment::Muscle->new();
      $factory->quiet(1);
      UNIVERSAL::can($o1, 'isa') or $self->throw('First operator must be an object', $o1);
      UNIVERSAL::can($o2, 'isa') or $self->throw('First operator must be an object', $o2);
      $o1->isa('Bio::Seq') or $self->throw('First operator must be a Bio::Seq object', $o1);
      $o2->isa('Bio::Seq') or $self->throw('Second operator must be a Bio::Seq object', $o2);
      $o1->id('op1');
      $o2->id('op2');
      my $aln = $factory->align([$o1, $o2]);
      my $out = 0;
      $out = ($ret eq 'sim') ? $aln->overall_percentage_identity('long')/100 : $aln->score;
      $factory->cleanup(); # This is to solve the issue #1
      defined $out or $self->throw('Empty value for '.$ret, $self, 'Bio::Polloc::Polloc::UnexpectedException');
      return $out;
   }
   $self->throw("Unknown numeric operation", $self->operation);
}

=head1 INTERNAL METHODS

Methods intended to be used only within the scope of Bio::Polloc::*

lib/Bio/Polloc/LociGroup.pm  view on Meta::CPAN

   # Compare
   LOCUS: for my $k (0 .. $#{$self->loci}){
      my $tgt = Bio::Polloc::GroupCriteria->_build_subseq(
      		$self->loci->[$k]->seq,
		$self->loci->[$k]->from-$size,
		$self->loci->[$k]->to+$size);
      next LOCUS unless $tgt; # <- This may be way too paranoic!
      $tgt->id('tgt');
      my $tgtrc = $tgt->revcom;
      $self->debug("Setting strand for ".$self->loci->[$k]->id) if defined $self->loci->[$k]->id;
      my $eval_fun = 'average_percentage_identity';
      #$eval_fun = 'overall_percentage_identity';
      if($factory->align([$ref, $tgt])->$eval_fun
      		< $factory->align([$ref,$tgtrc])->$eval_fun){
         $self->debug("Assuming negative strand, setting locus orientation");
	 $self->loci->[$k]->strand('-');
      }else{
         $self->debug("Assuming positive strand, setting locus orientation");
         $self->loci->[$k]->strand('+');
      }
   } # LOCUS
}

lib/Bio/Polloc/Locus/amplicon.pm  view on Meta::CPAN

   $self->{'_rev_primer'} = $value if defined $value;
   return $self->{'_rev_primer'};
}

=head2 score

Gets the score

=head3 Returns

The score (float or undef). As the percentage of the primers
matching the target sequence.

=cut

sub score {
   my($self,$value) = @_;
   $self->warn("Trying to set value via read-only method 'score()'") if defined $value;
   return 100 - 100 * ($self->errors || 0) * (
   		$self->fwd_primer and $self->rev_primer ?
		1/length $self->fwd_primer . $self->rev_primer : 1);

lib/Bio/Polloc/Locus/composition.pm  view on Meta::CPAN

=head3 Arguments

=over

=item -letters I<str>

The residues

=item -composition I<float>

The percentage of the sequence covered by the residues (letters).

=back

=cut

sub new {
   my($caller,@args) = @_;
   my $self = $caller->SUPER::new(@args);
   $self->_initialize(@args);
   return $self;

lib/Bio/Polloc/Locus/composition.pm  view on Meta::CPAN


sub letters {
   my($self,$value) = @_;
   $self->{'_letters'} = $value if defined $value;
   return $self->{'_letters'};
}


=head2 composition

Gets/sets the percentage of the sequence covered by the residues (letters).

=head3 Arguments

The percentage (float, optional).

=head3 Returns

The percentage (float or undef).

=cut

sub composition {
   my($self,$value) = @_;
   $self->{'_composition'} = $value if defined $value;
   return $self->{'_composition'};
}


lib/Bio/Polloc/Locus/repeat.pm  view on Meta::CPAN

=item -period I<float>

The period of the repeat (units length).

=item -exponent I<float>

The exponent (No of units).

=item -error I<float>

Mismatches percentage.

=item -repeats I<str>

Repetitive sequences, repeats space-separated.

=item -consensus I<str>

Repeats consensus.

=back

lib/Bio/Polloc/Locus/repeat.pm  view on Meta::CPAN

=cut

sub consensus {
   my($self,$value) = @_;
   $self->{'_consensus'} = $value if defined $value;
   return $self->{'_consensus'};
}

=head2 error

Gets/sets the error rate of the repeat.  I<I.e.>, the percentage of mismatches.

=head3 Arguments

The error (float).

=head3 Returns

The error (float or undef).

=cut

lib/Bio/Polloc/Rule/composition.pm  view on Meta::CPAN


Residues (str or undef)

=cut

sub letters { shift->_search_value("letters", shift) }


=head2 min_perc

Sets/gets the minimum percentage

=head2 Arguments

Percentage (float, optional)

=head2 Returns

Percentage (float or undef)

=cut

sub min_perc { shift->_search_value("min_perc", shift) }


=head2 max_perc

Sets/gets the maximum percentage

=head2 Arguments

Percentage (float, optional)

=head2 Returns

Percentage (float or undef)

=cut

lib/Bio/Polloc/Rule/composition.pm  view on Meta::CPAN

=item -letters

The residues to take into account as a string

=item -range

The allowed (perc.) range in the format 20..50

=item -min_perc

The minimum percentage (ignored if range is set)

=item -max_perc

The maximum percentage (ignored if range is set)

=back

=head2 Returns

Value (ref-to-hash or undef)

=cut

sub _qualify_value {

lib/Bio/Polloc/Rule/repeat.pm  view on Meta::CPAN

=item -allowsmall I<bool (int)>

If true, allows spurious results

=item -win I<float>

Process by sliding windows of size C<2*n> overlaping by C<n>

=item -minsim I<float>

Minimum similarity percent

=item -maxsim I<float>

Maximum similarity percent

=back

=head3 Return

Value (I<hashref> or C<undef>).

=head1 INTERNAL METHODS

Methods intended to be used only within the scope of Bio::Polloc::*

lib/Bio/Polloc/Rule/tandemrepeat.pm  view on Meta::CPAN

   # And finally parse it
   my $ontable = 0;
   my @feats = ();
   $run = Bio::Polloc::Polloc::IO->new(-file=>$outfile);
   while(my $line = $run->_readline){
      if($line =~ m/^Parameters:\s/){
         $ontable = 1;
      }elsif($ontable){
	 chomp $line;
	 next if $line =~ /^\s*$/;
	 #from to period-size copy-number consensus-size percent-matches percent-indels score A T C G entropy consensus sequence
	 #269 316 18 2.6 19 56 3 51 8 45 35 10 1.68 GTCGCGGCCACGTGCACCC GTCGCGTCCACGTGCGCCCGAGCCGGC...
	 my @v = split /\s+/, $line;
	 $#v==14 or $self->throw("Unexpected line $.",$line,"Bio::Polloc::Polloc::ParsingException");
	 # MINSIZE MAXSIZE MINPERIOD MAXPERIOD EXP MATCH MISMATCH INDELS MINSCORE MAXSCORE
	 $self->debug("Checking additional parameters");
	 next if length($v[14]) > $c_v{'maxsize'} or length($v[14]) < $c_v{'minsize'};
	 next if $v[2] > $c_v{'maxperiod'} or $v[2] < $c_v{'minperiod'};
	 next if $v[3] < $c_v{'exp'};
	 next if $v[7] < $c_v{'minscore'};
	 next if $c_v{'maxscore'} and $v[7] > $c_v{'maxscore'};

lib/Bio/Polloc/Rule/tandemrepeat.pm  view on Meta::CPAN

=item -minscore I<float>

Minimum score

=item -maxscore I<float>

Maximum score

=item -minsim I<float>

Minimum similarity percent

=item -maxsim I<float>

Maximum similarity percent

=item -pm I<float>

Match probability

=item -pi I<float>

Indel probability

=back

lib/Bio/Polloc/Typing/bandingPattern/amplification.pm  view on Meta::CPAN


sub flanking_size {
   my($self, $value) = @_;
   $self->{'_flanking_size'} = $value+0 if defined $value;
   return 500 unless defined $self->{'_flanking_size'};
   return $self->{'_flanking_size'};
}

=head2 annealing_errors

Gets/sets the maximum percentage of errors allowed for a primer to anneal.
0 by default.

=cut

sub annealing_errors {
   my($self, $value) = @_;
   $self->{'_annealing_errors'} = $value+0 if defined $value;
   return $self->{'_annealing_errors'} || 0;
}

scripts/polloc_primers.pl  view on Meta::CPAN

Example: C<"/tmp/polloc-primers.out">.

=item Draw

Should I produce graphical output?  Any non-empty string to
generate PNG images, or empty string (C<''>) to ignore graphical
output.

=item Consensus (I<float>)

Consensus percentage for primers design.

Default: C<100>.

=item Length (I<int>)

Length of the primers.

Default: C<20>.

=item Errors (I<int>)

scripts/polloc_vntrs.pl  view on Meta::CPAN

}

sub _advance_proto($$) {
   my($file, $msg) = @_;
   open ADV, ">", $file or die "I can not open the '$file' file: $!\n";
   print ADV $msg;
   close ADV;
}

sub csv_header() {
   return "ID\tGenome\tSeq\tFrom\tTo\tUnit length\tCopy number\tMismatch percent\tScore\t".
		"Left 500bp\tRight 500bp (rc)\tRepeats\tConsensus/Notes\n";
}
sub csv_line($$) {
   my $f = shift;
   my $n = shift;
   $n||= '';
   my $left = $f->seq->subseq(max(1, $f->from-500), $f->from);
   my $right = Bio::Seq->new(-seq=>$f->seq->subseq($f->to, min($f->seq->length, $f->to+500)));
   $right = $right->revcom->seq;
   my $seq;



( run in 0.496 second using v1.01-cache-2.11-cpan-709fd43a63f )