Changeset 270

Show
Ignore:
Timestamp:
09/24/09 21:45:45 (2 months ago)
Author:
bmoore
Message:

Modifications to some scripts by Barry

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bin/gff3_merge

    r257 r270  
    2020Options: 
    2121 
    22   -d The location of the MAKER datastore
     22  -d The location of the MAKER datastore index
    2323  -o Alternate base name for the output files. 
    2424 
  • bin/ipr_update_gff

    r204 r270  
    1515Description: 
    1616 
    17 This script will take a GFF33 file and an iprscan output file and add 
    18 fucntional annotations to the GFF3 attributes field. 
     17This script will take a GFF3 file and an iprscan output file and add 
     18Dbxrefs and Ontology_term fields to the GFF3 attributes field. 
    1919 
    2020"; 
  • bin/maker_functional_fasta

    r204 r270  
    4848 
    4949open (my $IN,  '<', $file) or die "Can't open $file for reading\n$!\n"; 
    50 unlink($file); 
    51 open (my $OUT, '>', $file) or die "Can't open $file for writing\n$!\n"; 
    5250 
    5351LINE: 
     
    5553 
    5654    if ($_ !~ /^>/) { 
    57         print $OUT $_; 
     55        print $_; 
    5856        next LINE; 
    5957    } 
     
    6866    $header .= join " ", @attrbs if @attrbs; 
    6967 
    70     print $OUT "$header\n"; 
     68    print "$header\n"; 
    7169 
    7270    } 
     
    102100                my $func = ''; 
    103101                $func .= "Similar to $name: " if $name; 
    104                 $func .= "$desc "  if $desc; 
     102                if ($func =~ /Similar to/) { 
     103                        $func .= "$desc "  if $desc; 
     104                } 
     105                else { 
     106                        $func .= "Similar to $desc "  if $desc; 
     107                } 
    105108                $func .= "($org)"  if $org; 
    106109                $func  = ('Name:"' . $func . '"') if $func; 
  • bin/maker_functional_gff

    r204 r270  
    1212Synopsis: 
    1313 
    14 maker_functional_fasta 
     14maker_functional_gff 
    1515 
    1616maker_functional_gff uniprot-sprot.fasta uniprot-sprot.blast.out maker.gff 
     
    1818Description: 
    1919 
    20 This script will take a uniprot-sprot fasta_file, a wu-blast -mformat 
     20This script will take a uniprot-sprot file a GFF3 file, and a wu-blast -mformat 
    21212 blast output file from a blast of maker proteins against 
    2222uniprot-sprot proteins and add functional annotations to the maker 
    23 GFF3 Notes attribute. 
    24  
     23GFF3 Notes attribute. Like this: 
    2524 
    2625"; 
     
    3433 
    3534open (my $IN,  '<', $gff_file) or die "Can't open $gff_file for reading\n$!\n"; 
    36 unlink($gff_file); 
    37 open (my $OUT, '>', $gff_file) or die "Can't open $gff_file for writing\n$!\n"; 
    3835 
    3936LINE: 
     
    4845            ($type ne 'mRNA' && $type ne 'gene') 
    4946           ) { 
    50                 print $OUT "$line\n"; 
     47                print "$line\n"; 
    5148                next LINE; 
    5249        } 
     
    5451        my ($id) = $attrb =~ /ID\s*=\s*(.*?);/; 
    5552 
    56         my $note = 'Note='
    57         if ($blast->{$id}) { 
    58                 $note .= $blast->{$id}{note} if $blast->{$id}{note}
     53        my $note
     54        if ($blast->{$id}{note}) { 
     55                $note .= $blast->{$id}{note}
    5956        } 
    6057        else { 
     
    6360 
    6461        $note = uri_escape($note, ';=%&,'); 
     62 
     63        $note = "Note=" . $note; 
    6564 
    6665        $line =~ s/;$//; 
     
    7372#       } 
    7473 
    75         print $OUT "$line\n"; 
     74        print "$line\n"; 
    7675} 
    7776#----------------------------------------------------------------------------- 
     
    159158 
    160159                my $gene_id = $gene_map->{$qid}; 
    161                 if (! $seen{$gene_id}) { 
     160                if ($gene_id && ! $seen{$gene_id}) { 
    162161                        $blast{$gene_id} = $fasta{$sid} || ''; 
    163162                        $seen{$gene_id}++; 
  • bin/maker_map_ids

    r199 r270  
    4444my ($help, $prefix, $justify, $sort_order); 
    4545my $opt_success = GetOptions('help'         => \$help, 
    46                              'prefix     => \$prefix, 
     46                             'prefix=s'     => \$prefix, 
    4747                             'justify=s'    => \$justify, 
    4848                             'sort_order=s' => \$sort_order, 
     
    134134sub sort_contigs { 
    135135        my ($a, $b, $sort_map) = @_; 
    136         return ($sort_order->{$a} <=> $sort_map->{$b}) if $sort_order; 
     136        return ($sort_order->{$a} <=> $sort_map->{$b}) if defined $sort_order; 
    137137        return ($sort_order->{$b} <=> $sort_map->{$a}); 
    138138} 
  • bin/map_fasta_ids

    r199 r270  
    4848        if  (/^>/) { 
    4949                my ($old_id) = $_ =~ /^>(\S+)/; 
    50                 my $new_id = $map{$old_id}; 
    51                 s/^>$old_id/>$new_id/g if $new_id; 
     50                if (exists $map{$old_id}) { 
     51                        my $new_id = $map{$old_id}; 
     52                        s/^>$old_id/>$new_id/g; 
     53                } 
     54                else { 
     55                        print STDERR "WARNING:  No mapping available for $old_id\n"; 
     56                } 
    5257        } 
    5358        print $OUT $_;