@datagrok/bio
Advanced tools
Comparing version 1.5.8 to 1.5.9
@@ -78,4 +78,4 @@ /** | ||
const forbidden = BioPackageDetectors.checkForbiddenWoSeparator(stats.freq); | ||
if (separator || !forbidden) { | ||
// const forbidden = BioPackageDetectors.checkForbiddenWoSeparator(stats.freq); | ||
if (separator || alphabet != 'UN') { | ||
const units = `${format}:${seqType}:${alphabet}`; | ||
@@ -127,7 +127,7 @@ col.setTag(DG.TAGS.UNITS, units); | ||
/** Without a separator, special symbols or digits are not allowed as monomers. */ | ||
static checkForbiddenWoSeparator(freq) { | ||
const forbiddenRe = /[\d!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/i; | ||
return Object.keys(freq).filter((m) => forbiddenRe.test(m)).length > 0; | ||
} | ||
// /** Without a separator, special symbols or digits are not allowed as monomers. */ | ||
// static checkForbiddenWoSeparator(freq) { | ||
// const forbiddenRe = /[\d!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/i; | ||
// return Object.keys(freq).filter((m) => forbiddenRe.test(m)).length > 0; | ||
// } | ||
@@ -134,0 +134,0 @@ /** Stats of sequences with specified splitter func, returns { freq, sameLength } */ |
@@ -5,3 +5,3 @@ { | ||
"friendlyName": "Bio", | ||
"version": "1.5.8", | ||
"version": "1.5.9", | ||
"description": "Bio is a [package](https://datagrok.ai/help/develop/develop#packages) for the [Datagrok](https://datagrok.ai) platform", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -108,5 +108,7 @@ import {after, before, category, test, expect, expectObject} from '@datagrok-libraries/utils/src/test'; | ||
msaComplex = 'msaComplex', | ||
idCsv = 'idCsv', | ||
sarSmallCsv = 'sarSmallCsv', | ||
helmCsv = 'helmCsv', | ||
testIdCsv = 'testIdCsv', | ||
testSmilesCsv = 'testSmilesCsv', | ||
testHelmCsv = 'testHelmCsv', | ||
testDemogCsv = 'testDemogCsv', | ||
} | ||
@@ -119,5 +121,7 @@ | ||
'msaComplex': 'System:AppData/Bio/samples/sample_MSA.csv', | ||
'idCsv': 'System:AppData/Bio/samples/id.csv', | ||
'sarSmallCsv': 'System:AppData/Bio/samples/sar-small.csv', | ||
'helmCsv': 'System:AppData/Bio/samples/sample_HELM.csv', | ||
'testDemogCsv': 'System:AppData/Bio/samples/testDemog.csv', | ||
'testIdCsv': 'System:AppData/Bio/samples/id.csv', | ||
'testHelmCsv': 'System:AppData/Bio/samples/testHelm.csv', | ||
'testSmilesCsv': 'System:AppData/Bio/samples/testSmiles.csv', | ||
}; | ||
@@ -243,7 +247,7 @@ | ||
test('samplesIdCsvNegativeID', async () => { | ||
await _testNeg(readSamples(Samples.idCsv), 'ID'); | ||
await _testNeg(readSamples(Samples.testIdCsv), 'ID'); | ||
}); | ||
test('samplesSarSmallCsvNegativeSmiles', async () => { | ||
await _testNeg(readSamples(Samples.sarSmallCsv), 'smiles'); | ||
await _testNeg(readSamples(Samples.testSmilesCsv), 'smiles'); | ||
}); | ||
@@ -258,2 +262,34 @@ | ||
}); | ||
// sample_testHelm.csb | ||
// columns: ID,Test type,HELM string,Valid?,Mol Weight,Mol Formula,SMILES | ||
test('samplesTestHelmNegativeID', async () => { | ||
await _testNeg(readSamples(Samples.testHelmCsv), 'ID'); | ||
}); | ||
test('samplesTestHelmNegativeTestType', async () => { | ||
await _testNeg(readSamples(Samples.testHelmCsv), 'Test type'); | ||
}); | ||
test('samplesTestHelmPositiveHelmString', async () => { | ||
await _testPos(readSamples(Samples.testHelmCsv), 'HELM string', 'HELM'); | ||
}); | ||
test('samplesTestHelmNegativeValid', async () => { | ||
await _testNeg(readSamples(Samples.testHelmCsv), 'Valid?'); | ||
}); | ||
test('samplesTestHelmNegativeMolWeight', async () => { | ||
await _testNeg(readSamples(Samples.testHelmCsv), 'Mol Weight'); | ||
}); | ||
test('samplesTestHelmNegativeMolFormula', async () => { | ||
await _testNeg(readSamples(Samples.testHelmCsv), 'Mol Formula'); | ||
}); | ||
test('samplesTestHelmNegativeSmiles', async () => { | ||
await _testNeg(readSamples(Samples.testHelmCsv), 'Smiles'); | ||
}); | ||
test('samplesTestDemogNegativeAll', async () => { | ||
const dfFunc: DfReaderFunc = readSamples(Samples.testDemogCsv); | ||
const df: DG.DataFrame = await dfFunc(); | ||
for (const col of df.columns.toList()) | ||
await _testNeg(dfFunc, col.name); | ||
}); | ||
}); | ||
@@ -260,0 +296,0 @@ |
@@ -12,3 +12,3 @@ import * as C from "./constants"; | ||
const lru = new DG.LruCache<any, any>(); | ||
const lru = new DG.LruCache<any, any>(); | ||
@@ -131,5 +131,2 @@ function getPalleteByType(paletteType: string): SeqPalette { | ||
export class MacromoleculeSequenceCellRenderer extends DG.GridCellRenderer { | ||
constructor() { | ||
super(); | ||
} | ||
@@ -167,3 +164,3 @@ get name(): string {return 'macromoleculeSequence';} | ||
host.setAttribute('data', gridCell.cell.value); | ||
gridCell.element = host; | ||
//@ts-ignore | ||
@@ -192,17 +189,17 @@ var canvas = new JSDraw2.Editor(host, { width: w, height: h, skin: "w8", viewonly: true }); | ||
const s: string = cell.value ?? ''; | ||
//TODO: can this be replaced/merged with splitSequence? | ||
const units = gridCell.cell.column.getTag(DG.TAGS.UNITS); | ||
const palette = getPalleteByType(paletteType); | ||
const separator = gridCell.cell.column.getTag('separator') ?? ''; | ||
const splitterFunc: SplitterFunc = WebLogo.getSplitter(units, gridCell.cell.column.getTag('separator') );// splitter, | ||
const subParts:string[] = splitterFunc(cell.value); | ||
console.log(subParts); | ||
const textSize = g.measureText(subParts.join('')); | ||
let x1 = Math.max(x, x + (w - textSize.width) / 2); | ||
subParts.forEach((amino, index) => { | ||
@@ -214,3 +211,3 @@ let [color, outerAmino,, pivot] = ChemPalette.getColorAAPivot(amino); | ||
}); | ||
g.restore(); | ||
@@ -217,0 +214,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12142728
67
96363
4