Commit 35a3d0cf authored by Mathieu Giraud's avatar Mathieu Giraud

js/clone.js: .getShortName, accept N lengths instead of full N

Shortens -6/0/ into 6//0.
parent 5ff1df38
......@@ -79,6 +79,7 @@ Clone.prototype = {
* */
REGEX_N: /^(-?\d*)\/([ACGT]*)\/(-?\d*)$/, // 6/ACCAT/
REGEX_N_SIZE: /^(-?\d*)\/(\d*)\/(-?\d*)$/, // 6/5/
REGEX_GENE: /(IGH|IGK|IGL|TRA|TRB|TRG|TRD)([\w-*]*)$/, // IGHV3-11*03
REGEX_GENE_IGNORE_ALLELE: /(IGH|IGK|IGL|TRA|TRB|TRG|TRD)([\w-]*)[\w-*]*$/, // IGHV3-11*03 (ignore *03)
......@@ -113,6 +114,14 @@ Clone.prototype = {
continue
}
// Shorten -6/0/ into 6//0
z = s.match(this.REGEX_N_SIZE);
if (z)
{
short_name_items.push(Math.abs(z[1]) + '/' + nullIfZero(z[2]) + '/' + Math.abs(z[3]))
continue
}
short_name_items.push(s)
}
......
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