class GritJiraIssue

Overview

Represents a GRIT JIRA curation issue and provides access to all specimen metadata needed by the curation workflow tools.

Authentication uses a Bearer token read from ~/.netrc (entry for jira.sanger.ac.uk). Per-specimen metadata is loaded from a YAML file whose path is stored in JIRA custom field customfield_13408. If the file is not accessible locally it is fetched via scp from tol22, and as a last resort downloaded as a JIRA attachment.

The #merged flag indicates that both haplotypes should be treated as a single merged assembly (hap1/hap2 or maternal/paternal dual-output mode).

Direct Known Subclasses

Defined in:

lib/grit_jira_issue.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : String, merged : Bool = false) #

Creates a new issue handle for name (e.g. "RC-1234"). Set merged to true for dual-haplotype assemblies.


[View source]

Instance Method Detail

def curated_dir : String #

Returns the target directory for curated output files. Derived from the decon file path; appended with .genomeark.<version> for GenomeArk specimens, or .<version> otherwise.


[View source]
def curation_pretext(fasta, output, no_email = false) : String #

Builds and returns the shell command string to invoke the curationpretext.sh Nextflow pipeline for fasta (must exist), writing output to output.

Writes a YAML params file next to fasta and assembles the command with the correct read files, Hi-C CRAMs, telomere sequence, and email flag. Pass no_email: true to suppress the LSF completion notification.


[View source]
def decon_file : String #

Returns the decontamination file path from JIRA custom field customfield_11677. May be a .bed file (contamination intervals) or a .fa.gz decontaminated FASTA.


[View source]
def get_json : JSON::Any #

Fetches the JIRA issue JSON via the REST API (/rest/api/2/issue/<id>). Raises if the request fails.


[View source]
def get_token : String #

Reads the Bearer token for jira.sanger.ac.uk from ~/.netrc. Raises if no matching entry is found.


[View source]
def get_yaml : YAML::Any #

Loads and parses the per-specimen YAML.

Resolution order:

  1. Path stored in JIRA custom field customfield_13408, read directly if it exists locally.
  2. Same path fetched via scp from tol22 into /tmp/.
  3. YAML attachment downloaded directly from the JIRA issue.

Raises if no YAML can be obtained.


[View source]
def geval_db : String #

Returns the geval database name from JIRA custom field customfield_11643, or an empty string if not set.


[View source]
def hic_read_dir : Array(YAML::Any) | Array(String) #

Returns the Hi-C read directory (or directories) as an array of strings. Handles both scalar and list values in the YAML.


[View source]
def json : JSON::Any #

Returns the parsed JIRA issue JSON, fetching it on first access.


[View source]
def merged : Bool #

[View source]
def ont_read_dir : String | Nil #

Returns the ONT read directory, or nil if not present in the YAML.


[View source]
def pacbio_read_dir : String | Nil #

Returns the PacBio read directory, or nil if not present in the YAML.


[View source]
def pretext_dir : String #

Returns the curated pretext map directory for this specimen under /nfs/treeoflife-01/teams/grit/data/curated_pretext_maps. For invertebrate/other prefixes (i, d, q, t, c) a two-level subdirectory lookup is used. Raises if no matching directory is found.


[View source]
def projects : Array(YAML::Any) #

Returns the list of project names associated with this specimen (e.g. ["DToL", "GenomeArk"]).


[View source]
def release_version : Int32 #

Returns the integer release version from JIRA custom field customfield_11609.


[View source]
def sample_dot_version : String #

Returns the specimen identifier in dot form: <tol_id>.<release_version>.


[View source]
def sample_version : String #

Returns the specimen identifier in underscore form: <tol_id>_<release_version>.


[View source]
def scientific_name : String #

Returns the scientific name of the specimen from the YAML species key.


[View source]
def taxonomy : String #

Looks up the NCBI taxonomy ID for this specimen via the EBI taxonomy REST API. First tries an exact scientific-name lookup, then falls back to an any-name search. Returns the taxon ID as a string. Raises if no result is found.


[View source]
def telomer : String #

Returns the telomere sequence from JIRA custom field customfield_11650, or an empty string if not set.


[View source]
def tol_id : String #

Returns the ToL specimen ID (e.g. "mMusMus1") from the YAML specimen key.


[View source]
def working_dir : String #

Returns the curation working directory on the HPC. Derived from #pacbio_read_dir or #ont_read_dir by replacing the genomic_data/... suffix with working/<tol_id>_<user>_curation.


[View source]
def yaml : YAML::Any #

Returns the parsed per-specimen YAML, fetching it on first access.


[View source]