function drush_tripal_feature_tripal_get_sequence

2.x tripal_feature.drush.inc drush_tripal_feature_tripal_get_sequence()
3.x tripal_feature.drush.inc drush_tripal_feature_tripal_get_sequence()
1.x tripal_feature.drush.inc drush_tripal_feature_tripal_get_sequence()

Retrieves the sequence of the indicated features

Related topics

File

tripal_feature/tripal_feature.drush.inc, line 73
Contains function relating to drush-integration of this module.

Code

function drush_tripal_feature_tripal_get_sequence() {

  $org_commonname = drush_get_option('org');
  $genus = drush_get_option('genus');
  $species = drush_get_option('species');
  $analysis_name = drush_get_option('analysis');
  $type = drush_get_option('type');
  $feature_name = drush_get_option('name');
  $upstream = drush_get_option('up') ? drush_get_option('up') : 0;
  $downstream = drush_get_option('down') ? drush_get_option('down') : 0;
  $derive_from_parent = drush_get_option('parent');
  $aggregate = drush_get_option('agg');
  $child = drush_get_option('child');
  $relationship = drush_get_option('relationship');
  $rel_part = drush_get_option('rel_part');
  $width = drush_get_option('width') ? drush_get_option('width') : 50;

  if ($relationship and !$rel_part) {
    print "Please specify both 'relationship' and a 'rel_part' arguments. Both must be used together\n";
    return;
  }

  $options = array(
    'org_commonname' => $org_commonname,
    'genus' => $genus,
    'species' => $species,
    'analysis_name' => $analysis_name,
    'type' => $type,
    'feature_name' => $feature_name,
    'upstream' => $upstream,
    'downstream' => $downstream,
    'derive_from_parent' => $derive_from_parent,
    'aggregate' => $aggregate,
    'sub_feature_types' => explode(',', $child),
    'relationship_type' => $relationship,
    'relationship_part' => $rel_part,
    'width' => $width
  );

  $seqs = tripal_get_bulk_feature_sequences($options);
  if (count($seqs) == 0) {
    print "No sequences found that match the criteria.";
  }

  foreach ($seqs as $seq) {
    print ">" . $seq['defline'] . "\r\n";
    print $seq['residues'] . "\r\n";
  }
}