Commit 15860a2c authored by Mikaël Salson's avatar Mikaël Salson

Merge branch 'feature-a/3569-airr-unproductivity-causes' into 'dev'

More AIRR fields, unproductivity causes

Closes #3569

See merge request !879
parents 3276b56d f2e35592
Pipeline #203183 failed with stages
in 39 minutes and 39 seconds
#include "output.h"
#include "segment.h"
#define NULL_VAL ""
#define AIRR_TRUE "T"
#define AIRR_FALSE "F"
string getout(json v)
{
......@@ -149,8 +152,8 @@ void SampleOutputVidjil::out(ostream &s, bool with_clones)
string TF_format_bool(string val)
{
if (val == "false") return "F" ;
if (val == "true") return "T" ;
if (val == "false") return AIRR_FALSE ;
if (val == "true") return AIRR_TRUE ;
return val ;
}
......@@ -182,7 +185,18 @@ map <string, string> CloneOutputAIRR::fields()
fields["cdr3_aa"] = get(KEY_SEG, "cdr3", "aa");
fields["junction"] = NULL_VAL;
fields["junction_aa"] = get(KEY_SEG, "junction", "aa");
fields["productive"] = TF_format_bool(get(KEY_SEG, "junction", "productive"));
bool productive = (fields["productive"] == AIRR_TRUE); // thsus false for both AIRR_FALSE and NULL_VAL
string unproductive = get(KEY_SEG, "junction", "unproductive");
fields["vj_in_frame"] = productive ? AIRR_TRUE
: unproductive == UNPROD_STOP_CODON ? AIRR_TRUE
: unproductive == UNPROD_OUT_OF_FRAME ? AIRR_FALSE
: NULL_VAL;
fields["stop_codon"] = productive ? AIRR_FALSE
: unproductive == UNPROD_STOP_CODON ? AIRR_TRUE
: NULL_VAL;
fields["rev_comp"] = NULL_VAL;
fields["warnings"] = getWarnings();
......@@ -200,6 +214,7 @@ void SampleOutputAIRR::out(ostream &s)
"sequence",
"productive",
"vj_in_frame", "stop_codon",
"junction_aa",
"junction",
"cdr3_aa",
......
......@@ -29,9 +29,9 @@ $ One clone has 8 reads, two clones have 5 reads
1:IGH 8
2:IGH 5
$ Two clones are productive, no clone is labeled as non-productive
2:\tT\t
0:\tF\t
$ Two clones are productive (productive, vj_in_frame, NOT stop_codon), no clone is labeled as non-productive
2:\tT\tT\tF\t
0:\tF\t[FT]\t[FT]\t
$ v_call for 2 clones (-z 2)
2:IGHV
......
......@@ -17,4 +17,17 @@ $ Cause of unproductivity
:clones[0].seg.junction.unproductive: stop-codon
0:clones[1].seg.junction.unproductive
:clones[2].seg.junction.unproductive: out-of-frame
:clones[3].seg.junction.unproductive: too-short
\ No newline at end of file
:clones[3].seg.junction.unproductive: too-short
!OUTPUT_FILE: out/productive_stop_outframe.tsv
!LAUNCH: echo
!OPTIONS: --mod Jr
$ Clone 001, AIRR: NOT productive, vdj_in_frame, stop_codon
1:001.*\tF\tT\tT\t
$ Clone 002, AIRR: productive, vdj_in_frame, NOT stop_codon
1:002.*\tT\tT\tF\t
$ Clone 003, AIRR: NOT productive, NOT vdj_in_frame, NULL stop_codon
1:003.*\tF\tF\t\t
......@@ -724,6 +724,8 @@ Using `-c designations` trigger a separate analysis for each read, but this is u
| cdr3_aa | string | Amino acid translation of the cdr3 field. <br />*implemented*
| cdr3_sequence_start, cdr3_sequence_end | number | Start/end position of the CDR3 in the query sequence (1-based closed interval). <br />*implemented* |
| productive | boolean | True if the V(D)J sequence is predicted to be productive. <br /> *true, false, or null when no CDR3 has been detected* |
| vj_in_frame | boolean | True if the V and J gene alignments are in-frame. <br /> *true, false, or null when no CDR3 has been detected* |
| stop_codon | boolean | True if the aligned sequence contains a stop codon. <br /> *true, false, or null when vj_in_frame is false* |
| sequence_alignment | string | Aligned portion of query sequence, including any indel corrections or numbering spacers, such as IMGT-gaps. Typically, this will include only the V(D)J region, but that is not a requirement. <br /> *null* |
| germline_alignment | string | Assembled, aligned, fully length inferred germline sequence spanning the same region as the sequence_alignment field (typically the V(D)J region) and including the same set of corrections and spacers (if any). <br />*null*
| v_cigar, d_cigar, j_cigar | string | CIGAR strings for the V/D/J gene <br />*null*.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment