Commit 7066cb07 authored by Mikaël Salson's avatar Mikaël Salson

Merge branch 'feature-a/2232-tag-D7-27--J1' into 'dev'

D7-27--J1 non-recombination should be warned

Closes #2232

See merge request !242
parents a9172a17 c513e55a
Pipeline #32761 canceled with stages
in 4 seconds
......@@ -249,6 +249,10 @@ int Segmenter::getRight() const {
return box_J->start;
}
int Segmenter::getMidLength() const {
return box_J->start - box_V->end - 1;
}
int Segmenter::getLeftD() const {
return box_D->start;
}
......@@ -1313,6 +1317,20 @@ void FineSegmenter::findCDR3(){
// Reminder: JUNCTIONstart is 1-based
}
void FineSegmenter::checkWarnings(json &json_clone)
{
if (isSegmented())
{
// Non-recombined D7-27/J1 sequence
if ((box_V->ref_label.find("IGHD7-27") != string::npos)
&& (box_J->ref_label.find("IGHJ1") != string::npos)
&& ((getMidLength() >= 90) || (getMidLength() <= 94)))
{
json_add_warning(json_clone, "W61", "Non-recombined D7-27/J1 sequence", LEVEL_ERROR);
}
}
}
json FineSegmenter::toJson(){
json seg;
......
......@@ -231,7 +231,14 @@ protected:
* @return the right position (on forward strand) of the segmentation
*/
int getRight() const;
/**
* @return the number of positions between the left and the right positions
*/
int getMidLength() const;
/**
* @return the left position (on forward strand) of the D segmentation.
*/
......@@ -390,6 +397,7 @@ class FineSegmenter : public Segmenter
*/
void findCDR3();
void checkWarnings(json &json_clone);
json toJson();
};
......
>NC_000014.9:c105865580-105865420 Homo sapiens chromosome 14, GRCh38.p12 Primary Assembly
TGAGCTGAGAACCACTGTGCTAACTGGGGACACAGTGATTGGCAGCTCTACAAAAACCATGCTCCCCCGG
GACCCCGGGCTGTGGGTTTCTGTAGCCCCTGGCTCAGGGCTGACTCACCGTGGCTGAATACTTCCAGCAC
TGGGGCCAGGGCACCCTGGTC
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -KA -g $VIDJIL_DIR/germline/homo-sapiens.g:IGH+ -r 4 -b co $VIDJIL_DATA/D7-27--J1.fa ; cat out/co.vidjil
# Test D7-27 0/92/0 J1 non-recombination
$ Segmented on IGH+
1: "germline": "IGH\+"
$ Correct (non-)recombination
1: "name": "IGHD7-27.01 0/[ACGT]{92}/0 IGHJ1.01"
$ Warning
1: "code": "W61"
1: "msg": "Non-recombined D7-27/J1 sequence"
......@@ -159,6 +159,7 @@ void testSegmentationCause(IndexTypes index) {
TEST_KMER_JUNCTION, ks.getInfoLineWithAffects());
TAP_TEST_EQUAL(ks.getLeft(), 17, TEST_KMER_LEFT, "left = " << ks.getLeft());
TAP_TEST_EQUAL(ks.getRight(), 18, TEST_KMER_RIGHT, "right = " << ks.getRight());
TAP_TEST_EQUAL(ks.getMidLength(), 0, TEST_KMER_RIGHT, "mid length = " << ks.getMidLength());
ks.setSegmentationStatus(NOT_PROCESSED);
TAP_TEST(! ks.isSegmented(), TEST_SET_SEGMENTATION_CAUSE, ks.getInfoLineWithAffects());
......
......@@ -1424,6 +1424,8 @@ int main (int argc, char **argv)
out_clone << endl;
} // end if (seg.isSegmented())
seg.checkWarnings(json_clone);
json_data_segment[it->first] = json_clone;
if (output_sequences_by_cluster) // -a option, output all sequences
......
......@@ -42,8 +42,8 @@ Warnings which were implemented ([x]) have a fixed code that should not be chang
- [ ] Possible strand ambiguity
*Strange recombination (FineSegmenter in vidjil-algo), V and J genes*
- [ ] W6x Co-linear recombination D7-J1 #2232
- [ ] Potential co-linear genome match (pos xxxxxx) #1664 #1629
- [ ] W61 Non-recombined D7-27/J1 sequence #2232
- [ ] Potential di-mer #2820
- [ ] Very large deletion (xxx bp) #2909
- [ ] Unexpected recombination
......
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