elsif ( $script eq "blat_seq" ) { script_blat_seq( $in, $out, $options ) }
elsif ( $script eq "match_seq" ) { script_match_seq( $in, $out, $options ) }
elsif ( $script eq "create_vmatch_index" ) { script_create_vmatch_index( $in, $out, $options ) }
- elsif ( $script eq "create_fixedstep_index" ) { script_create_fixedstep_index( $in, $out, $options ) }
elsif ( $script eq "vmatch_seq" ) { script_vmatch_seq( $in, $out, $options ) }
elsif ( $script eq "write_fasta" ) { script_write_fasta( $in, $out, $options ) }
elsif ( $script eq "write_align" ) { script_write_align( $in, $out, $options ) }
no_stream|x
);
}
- elsif ( $script eq "create_fixedstep_index" )
- {
- @options = qw(
- index_name|i=s
- no_stream|x
- );
- }
elsif ( $script eq "vmatch_seq" )
{
@options = qw(
}
Maasha::Common::error( qq(no --database specified) ) if $script eq "create_blast_db" and not $options{ "database" };
- Maasha::Common::error( qq(no --index_name specified) ) if $script =~ /create_vmatch_index|create_fixedstep_index/ and not $options{ "index_name" };
+ Maasha::Common::error( qq(no --index_name specified) ) if $script =~ /create_vmatch_index/ and not $options{ "index_name" };
Maasha::Common::error( qq(no --database or --genome specified) ) if $script eq "blast_seq" and not $options{ "genome" } and not $options{ "database" };
Maasha::Common::error( qq(both --database and --genome specified) ) if $script eq "blast_seq" and $options{ "genome" } and $options{ "database" };
Maasha::Common::error( qq(no --index_name or --genome specified) ) if $script eq "vmatch_seq" and not $options{ "genome" } and not $options{ "index_name" };
}
-sub script_create_fixedstep_index
-{
- # Martin A. Hansen, January 2008.
-
- # Create a fixedStep index from records in the stream.
-
- my ( $in, # handle to in stream
- $out, # handle to out stream
- $options, # options hash
- ) = @_;
-
- # Returns nothing.
-
- my ( $record, $file_tmp, $fh_tmp, $vals, $index );
-
- $file_tmp = "$BP_TMP/fixedstep.tmp";
-
- $fh_tmp = Maasha::Common::write_open( $file_tmp );
-
- while ( $record = get_record( $in ) )
- {
- if ( $record->{ "CHR" } and $record->{ "CHR_BEG" } and $record->{ "STEP" } and $record->{ "VALS" } )
- {
- print $fh_tmp "fixedStep chrom=$record->{ 'CHR' } start=$record->{ 'CHR_BEG' } step=$record->{ 'STEP' }\n";
-
- $vals = $record->{ 'VALS' };
-
- $vals =~ tr/,/\n/;
-
- print $fh_tmp "$vals\n";
- }
- }
-
- close $fh_tmp;
-
- $index = Maasha::UCSC::fixedstep_index_create( $file_tmp );
-
- unlink $file_tmp;
-
- Maasha::UCSC::fixedstep_index_store( $options->{ 'index_name' }, $index );
-}
-
-
sub script_vmatch_seq
{
# Martin A. Hansen, August 2007.