@teselagen/sequence-utils 0.3.38-beta.3 → 0.3.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DNAComplementMap.d.ts +1 -1
- package/addGapsToSeqReads.d.ts +3 -16
- package/adjustAnnotationsToInsert.d.ts +1 -2
- package/adjustBpsToReplaceOrInsert.d.ts +1 -2
- package/aliasedEnzymesByName.d.ts +1 -37
- package/aminoAcidToDegenerateDnaMap.d.ts +31 -1
- package/aminoAcidToDegenerateRnaMap.d.ts +1 -1
- package/annotateSingleSeq.d.ts +4 -5
- package/annotationTypes.d.ts +2 -2
- package/autoAnnotate.d.ts +8 -17
- package/bioData.d.ts +58 -10
- package/calculateEndStability.d.ts +1 -1
- package/calculateNebTa.d.ts +1 -6
- package/calculateNebTm.d.ts +4 -6
- package/calculatePercentGC.d.ts +1 -1
- package/calculateSantaLuciaTm.d.ts +114 -28
- package/calculateTm.d.ts +1 -13
- package/computeDigestFragments.d.ts +24 -30
- package/condensePairwiseAlignmentDifferences.d.ts +1 -1
- package/convertAACaretPositionOrRangeToDna.d.ts +1 -2
- package/convertDnaCaretPositionOrRangeToAA.d.ts +1 -2
- package/cutSequenceByRestrictionEnzyme.d.ts +1 -2
- package/defaultEnzymesByName.d.ts +1 -2
- package/degenerateDnaToAminoAcidMap.d.ts +1 -1
- package/degenerateRnaToAminoAcidMap.d.ts +1 -1
- package/deleteSequenceDataAtRange.d.ts +1 -2
- package/diffUtils.d.ts +7 -9
- package/doesEnzymeChopOutsideOfRecognitionSite.d.ts +1 -2
- package/featureTypesAndColors.d.ts +6 -19
- package/filterSequenceString.d.ts +10 -14
- package/findApproxMatches.d.ts +1 -7
- package/findNearestRangeOfSequenceOverlapToPosition.d.ts +1 -2
- package/findOrfsInPlasmid.d.ts +11 -2
- package/findSequenceMatches.d.ts +1 -11
- package/generateAnnotations.d.ts +1 -2
- package/generateSequenceData.d.ts +13 -8
- package/getAllInsertionsInSeqReads.d.ts +1 -11
- package/getAminoAcidDataForEachBaseOfDna.d.ts +5 -6
- package/getAminoAcidFromSequenceTriplet.d.ts +1 -1
- package/getAminoAcidStringFromSequenceString.d.ts +1 -3
- package/getCodonRangeForAASliver.d.ts +4 -3
- package/getComplementAminoAcidStringFromSequenceString.d.ts +1 -1
- package/getComplementSequenceAndAnnotations.d.ts +1 -5
- package/getComplementSequenceString.d.ts +1 -1
- package/getCutsiteType.d.ts +1 -2
- package/getCutsitesFromSequence.d.ts +1 -2
- package/getDegenerateDnaStringFromAAString.d.ts +1 -1
- package/getDegenerateRnaStringFromAAString.d.ts +1 -1
- package/getDigestFragmentsForCutsites.d.ts +1 -4
- package/getDigestFragmentsForRestrictionEnzymes.d.ts +1 -8
- package/getInsertBetweenVals.d.ts +1 -2
- package/getLeftAndRightOfSequenceInRangeGivenPosition.d.ts +1 -2
- package/getOrfsFromSequence.d.ts +11 -17
- package/getOverlapBetweenTwoSequences.d.ts +1 -2
- package/getPossiblePartsFromSequenceAndEnzymes.d.ts +1 -18
- package/getReverseAminoAcidStringFromSequenceString.d.ts +1 -1
- package/getReverseComplementAminoAcidStringFromSequenceString.d.ts +1 -1
- package/getReverseComplementAnnotation.d.ts +1 -11
- package/getReverseComplementSequenceAndAnnotations.d.ts +1 -5
- package/getReverseComplementSequenceString.d.ts +1 -1
- package/getReverseSequenceString.d.ts +1 -1
- package/getSequenceDataBetweenRange.d.ts +1 -9
- package/getVirtualDigest.d.ts +10 -11
- package/guessIfSequenceIsDnaAndNotProtein.d.ts +1 -5
- package/index.cjs +491 -728
- package/index.d.ts +5 -8
- package/index.js +491 -728
- package/index.umd.cjs +491 -728
- package/insertGapsIntoRefSeq.d.ts +1 -2
- package/insertSequenceDataAtPositionOrRange.d.ts +1 -10
- package/isEnzymeType2S.d.ts +1 -2
- package/mapAnnotationsToRows.d.ts +1 -9
- package/package.json +9 -12
- package/prepareCircularViewData.d.ts +1 -2
- package/prepareRowData.d.ts +3 -7
- package/proteinAlphabet.d.ts +1 -1
- package/rotateBpsToPosition.d.ts +1 -1
- package/rotateSequenceDataToPosition.d.ts +1 -3
- package/shiftAnnotationsByLen.d.ts +3 -4
- package/src/autoAnnotate.test.js +1 -0
- package/src/getSequenceDataBetweenRange.js +11 -2
- package/src/getSequenceDataBetweenRange.test.js +42 -0
- package/src/prepareRowData_output1.json +0 -1
- package/threeLetterSequenceStringToAminoAcidMap.d.ts +921 -11
- package/tidyUpAnnotation.d.ts +11 -13
- package/tidyUpSequenceData.d.ts +1 -15
- package/src/DNAComplementMap.ts +0 -32
- package/src/addGapsToSeqReads.ts +0 -436
- package/src/adjustAnnotationsToInsert.ts +0 -20
- package/src/adjustBpsToReplaceOrInsert.ts +0 -73
- package/src/aliasedEnzymesByName.ts +0 -7366
- package/src/aminoAcidToDegenerateDnaMap.ts +0 -32
- package/src/aminoAcidToDegenerateRnaMap.ts +0 -32
- package/src/annotateSingleSeq.ts +0 -37
- package/src/annotationTypes.ts +0 -23
- package/src/autoAnnotate.ts +0 -290
- package/src/bioData.ts +0 -65
- package/src/calculateEndStability.ts +0 -91
- package/src/calculateNebTa.ts +0 -46
- package/src/calculateNebTm.ts +0 -132
- package/src/calculatePercentGC.ts +0 -3
- package/src/calculateSantaLuciaTm.ts +0 -184
- package/src/calculateTm.ts +0 -242
- package/src/computeDigestFragments.ts +0 -238
- package/src/condensePairwiseAlignmentDifferences.ts +0 -85
- package/src/convertAACaretPositionOrRangeToDna.ts +0 -28
- package/src/convertDnaCaretPositionOrRangeToAA.ts +0 -28
- package/src/cutSequenceByRestrictionEnzyme.ts +0 -345
- package/src/defaultEnzymesByName.ts +0 -280
- package/src/degenerateDnaToAminoAcidMap.ts +0 -5
- package/src/degenerateRnaToAminoAcidMap.ts +0 -5
- package/src/deleteSequenceDataAtRange.ts +0 -13
- package/src/diffUtils.ts +0 -80
- package/src/doesEnzymeChopOutsideOfRecognitionSite.ts +0 -16
- package/src/featureTypesAndColors.ts +0 -167
- package/src/filterSequenceString.ts +0 -153
- package/src/findApproxMatches.ts +0 -58
- package/src/findNearestRangeOfSequenceOverlapToPosition.ts +0 -43
- package/src/findOrfsInPlasmid.ts +0 -31
- package/src/findSequenceMatches.ts +0 -154
- package/src/generateAnnotations.ts +0 -39
- package/src/generateSequenceData.ts +0 -212
- package/src/getAllInsertionsInSeqReads.ts +0 -100
- package/src/getAminoAcidDataForEachBaseOfDna.ts +0 -305
- package/src/getAminoAcidFromSequenceTriplet.ts +0 -27
- package/src/getAminoAcidStringFromSequenceString.ts +0 -36
- package/src/getCodonRangeForAASliver.ts +0 -73
- package/src/getComplementAminoAcidStringFromSequenceString.ts +0 -10
- package/src/getComplementSequenceAndAnnotations.ts +0 -25
- package/src/getComplementSequenceString.ts +0 -23
- package/src/getCutsiteType.ts +0 -18
- package/src/getCutsitesFromSequence.ts +0 -22
- package/src/getDegenerateDnaStringFromAAString.ts +0 -15
- package/src/getDegenerateRnaStringFromAAString.ts +0 -15
- package/src/getDigestFragmentsForCutsites.ts +0 -126
- package/src/getDigestFragmentsForRestrictionEnzymes.ts +0 -50
- package/src/getInsertBetweenVals.ts +0 -31
- package/src/getLeftAndRightOfSequenceInRangeGivenPosition.ts +0 -40
- package/src/getMassOfAaString.ts +0 -29
- package/src/getOrfsFromSequence.ts +0 -132
- package/src/getOverlapBetweenTwoSequences.ts +0 -30
- package/src/getPossiblePartsFromSequenceAndEnzymes.ts +0 -149
- package/src/getReverseAminoAcidStringFromSequenceString.ts +0 -22
- package/src/getReverseComplementAminoAcidStringFromSequenceString.ts +0 -10
- package/src/getReverseComplementAnnotation.ts +0 -33
- package/src/getReverseComplementSequenceAndAnnotations.ts +0 -46
- package/src/getReverseComplementSequenceString.ts +0 -18
- package/src/getReverseSequenceString.ts +0 -12
- package/src/getSequenceDataBetweenRange.ts +0 -154
- package/src/getVirtualDigest.ts +0 -139
- package/src/guessIfSequenceIsDnaAndNotProtein.ts +0 -39
- package/src/index.test.ts +0 -43
- package/src/index.ts +0 -111
- package/src/insertGapsIntoRefSeq.ts +0 -43
- package/src/insertSequenceDataAtPosition.ts +0 -2
- package/src/insertSequenceDataAtPositionOrRange.ts +0 -328
- package/src/isEnzymeType2S.ts +0 -5
- package/src/mapAnnotationsToRows.ts +0 -256
- package/src/prepareCircularViewData.ts +0 -24
- package/src/prepareRowData.ts +0 -61
- package/src/proteinAlphabet.ts +0 -271
- package/src/rotateBpsToPosition.ts +0 -12
- package/src/rotateSequenceDataToPosition.ts +0 -54
- package/src/shiftAnnotationsByLen.ts +0 -24
- package/src/threeLetterSequenceStringToAminoAcidMap.ts +0 -198
- package/src/tidyUpAnnotation.ts +0 -205
- package/src/tidyUpSequenceData.ts +0 -213
- package/src/types.ts +0 -109
- package/types.d.ts +0 -105
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function insertGapsIntoRefSeq(refSeq: string, seqReads: SeqRead[]): string;
|
|
1
|
+
export default function insertGapsIntoRefSeq(refSeq: any, seqReads: any): any;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { SequenceData } from './types';
|
|
3
|
-
interface InsertSequenceDataOptions {
|
|
4
|
-
maintainOriginSplit?: boolean;
|
|
5
|
-
doNotRemoveInvalidChars?: boolean;
|
|
6
|
-
topLevelSeqData?: SequenceData;
|
|
7
|
-
[key: string]: unknown;
|
|
8
|
-
}
|
|
9
|
-
export default function insertSequenceDataAtPositionOrRange(_sequenceDataToInsert: SequenceData, _existingSequenceData: SequenceData, caretPositionOrRange: number | Range, options?: InsertSequenceDataOptions): SequenceData;
|
|
10
|
-
export {};
|
|
1
|
+
export default function insertSequenceDataAtPositionOrRange(_sequenceDataToInsert: any, _existingSequenceData: any, caretPositionOrRange: any, options?: {}): any;
|
package/isEnzymeType2S.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function isEnzymeType2S(e: RestrictionEnzyme): boolean;
|
|
1
|
+
export default function isEnzymeType2S(e: any): boolean;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export interface MappedAnnotation extends Annotation {
|
|
3
|
-
yOffset?: number;
|
|
4
|
-
enclosingRangeType?: "beginning" | "end" | "beginningAndEnd";
|
|
5
|
-
annotation?: Annotation;
|
|
6
|
-
}
|
|
7
|
-
export default function mapAnnotationsToRows(annotations: Annotation[], sequenceLength: number, bpsPerRow: number, { splitForwardReverse }?: {
|
|
8
|
-
splitForwardReverse?: boolean;
|
|
9
|
-
}): Record<string | number, MappedAnnotation[]>;
|
|
1
|
+
export default function mapAnnotationsToRows(annotations: any, sequenceLength: any, bpsPerRow: any, { splitForwardReverse }?: {}): {};
|
package/package.json
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teselagen/sequence-utils",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.41",
|
|
4
|
+
"repository": "https://github.com/TeselaGen/tg-oss",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"dependencies": {
|
|
6
|
-
"@teselagen/range-utils": "0.3.14-beta.3",
|
|
7
7
|
"escape-string-regexp": "5.0.0",
|
|
8
8
|
"jsondiffpatch": "0.7.3",
|
|
9
|
+
"string-splice": "^1.3.0",
|
|
9
10
|
"lodash-es": "^4.17.21",
|
|
10
|
-
"shortid": "2.2.16"
|
|
11
|
+
"shortid": "2.2.16",
|
|
12
|
+
"@teselagen/range-utils": "0.3.18"
|
|
11
13
|
},
|
|
12
14
|
"exports": {
|
|
13
15
|
".": {
|
|
14
|
-
"import": "./
|
|
15
|
-
"require": "./
|
|
16
|
+
"import": "./index.js",
|
|
17
|
+
"require": "./index.cjs"
|
|
16
18
|
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
"@types/lodash-es": "^4.17.12",
|
|
20
|
-
"@types/shortid": "^2.2.0"
|
|
21
|
-
},
|
|
22
|
-
"license": "MIT"
|
|
23
|
-
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export default function prepareCircularViewData(sequenceData: SequenceData): SequenceData;
|
|
1
|
+
export default function prepareCircularViewData(sequenceData: any): any;
|
package/prepareRowData.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { SequenceData } from './types';
|
|
3
|
-
export interface RowData {
|
|
1
|
+
export default function prepareRowData(sequenceData: any, bpsPerRow: any): {
|
|
4
2
|
rowNumber: number;
|
|
5
3
|
start: number;
|
|
6
4
|
end: number;
|
|
7
|
-
sequence:
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
export default function prepareRowData(sequenceData: SequenceData, bpsPerRow: number): RowData[];
|
|
5
|
+
sequence: any;
|
|
6
|
+
}[];
|
package/proteinAlphabet.d.ts
CHANGED
package/rotateBpsToPosition.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function rotateBpsToPosition(bps:
|
|
1
|
+
export default function rotateBpsToPosition(bps: any, caretPosition: any): any;
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { SequenceData } from './types';
|
|
3
|
-
export default function rotateSequenceDataToPosition(sequenceData: SequenceData, caretPosition: number, options?: TidyUpSequenceDataOptions): SequenceData;
|
|
1
|
+
export default function rotateSequenceDataToPosition(sequenceData: any, caretPosition: any, options: any): any;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { SequenceData } from './types';
|
|
2
1
|
export default function shiftAnnotationsByLen({ seqData, caretPosition, insertLength }: {
|
|
3
|
-
seqData:
|
|
4
|
-
caretPosition:
|
|
5
|
-
insertLength:
|
|
2
|
+
seqData: any;
|
|
3
|
+
caretPosition: any;
|
|
4
|
+
insertLength: any;
|
|
6
5
|
}): void;
|
package/src/autoAnnotate.test.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { flatMap, extend, forEach, startCase } from "lodash-es";
|
|
2
|
-
import { getRangeLength } from "@teselagen/range-utils";
|
|
2
|
+
import { getRangeLength, isRangeWithinRange } from "@teselagen/range-utils";
|
|
3
3
|
import convertDnaCaretPositionOrRangeToAa from "./convertDnaCaretPositionOrRangeToAA";
|
|
4
4
|
import insertSequenceDataAtPosition from "./insertSequenceDataAtPosition";
|
|
5
5
|
import {
|
|
@@ -112,7 +112,16 @@ function getAnnotationsBetweenRange(
|
|
|
112
112
|
const overlaps = getZeroedRangeOverlaps(annotation, range, maxLength).map(
|
|
113
113
|
overlap => {
|
|
114
114
|
//we get back 1 or more overlaps here
|
|
115
|
-
|
|
115
|
+
const allLocations = annotation.locations;
|
|
116
|
+
if (allLocations && allLocations.length) {
|
|
117
|
+
// Filter the 'allLocations' that in this overlap
|
|
118
|
+
const newLocations = allLocations.filter(loc => {
|
|
119
|
+
return isRangeWithinRange(loc, overlap, maxLength);
|
|
120
|
+
})
|
|
121
|
+
return extend({}, annotation, overlap, {
|
|
122
|
+
locations: newLocations
|
|
123
|
+
});
|
|
124
|
+
}
|
|
116
125
|
return extend({}, annotation, overlap);
|
|
117
126
|
}
|
|
118
127
|
);
|
|
@@ -462,4 +462,46 @@ describe("getSequenceDataBetweenRange", () => {
|
|
|
462
462
|
]
|
|
463
463
|
});
|
|
464
464
|
});
|
|
465
|
+
it("feature with locations, circular sequence, non-fully enclosing range range that cross the origin", () =>{
|
|
466
|
+
const res = getSequenceDataBetweenRange(
|
|
467
|
+
{
|
|
468
|
+
circular: true,
|
|
469
|
+
sequence: "gggatgcatgca",
|
|
470
|
+
features: [
|
|
471
|
+
{
|
|
472
|
+
start: 5,
|
|
473
|
+
end: 3,
|
|
474
|
+
locations: [
|
|
475
|
+
{ start: 5, end: 6 },
|
|
476
|
+
{ start: 7, end: 8 },
|
|
477
|
+
{ start: 9, end: 1 },
|
|
478
|
+
{ start: 2, end: 3 }
|
|
479
|
+
],
|
|
480
|
+
name: "testing"
|
|
481
|
+
}
|
|
482
|
+
]
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
start: 2,
|
|
486
|
+
end: 7
|
|
487
|
+
}
|
|
488
|
+
);
|
|
489
|
+
res.should.containSubset({
|
|
490
|
+
sequence: "gatgca",
|
|
491
|
+
features: [
|
|
492
|
+
{
|
|
493
|
+
start: 0,
|
|
494
|
+
end: 1,
|
|
495
|
+
name: "testing",
|
|
496
|
+
locations: undefined
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
start: 3,
|
|
500
|
+
end: 5,
|
|
501
|
+
name: "testing",
|
|
502
|
+
locations: [{start:3, end:4}, {start:5, end:5}]
|
|
503
|
+
}
|
|
504
|
+
]
|
|
505
|
+
});
|
|
506
|
+
})
|
|
465
507
|
});
|