Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handler: props => {
props.onCreateNewFromSubsequence(
getSequenceDataBetweenRange(props.sequenceData, props.selectionLayer),
props
);
}
// hotkey: "mod+x"
text: () => {
const { selectionLayer } =
this.props.store.getState().VectorEditor
.__allEditorsOptions.alignments[
this.props.id
] || {};
const seqDataToCopy = getSequenceDataBetweenRange(
alignmentData,
selectionLayer
).sequence;
const seqDataToCopyAsFasta = `>${name}\r\n${seqDataToCopy}\r\n`;
return seqDataToCopyAsFasta;
}
}
text: () => {
const { selectionLayer, editorName, store } = this.props;
const { sequenceData, copyOptions } = store.getState().VectorEditor[
editorName
];
const selectedSeqData = getSequenceDataBetweenRange(
sequenceData,
selectionLayer,
{
excludePartial: {
features: !copyOptions.partialFeatures,
parts: !copyOptions.partialParts
},
exclude: {
features: !copyOptions.features,
parts: !copyOptions.parts
}
}
);
const sequenceDataToCopy = transformFunc(
selectedSeqData,
sequenceData
const GCContent = (numDecimalDigits = 0) =>
calculatePercentGC(
getSequenceDataBetweenRange(sequenceData, selectionLayer).sequence
).toFixed(numDecimalDigits);
const seqLen = divideBy3(length, isProtein);
alignmentTracks.forEach(track => {
const seqDataToCopy = getSequenceDataBetweenRange(
track.alignmentData,
selectionLayer
).sequence;
seqDataOfAllTracksToCopy.push(
`>${track.alignmentData.name}\r\n${seqDataToCopy}\r\n`
);
});
return seqDataOfAllTracksToCopy.join("");
handleCutOrCopy = isCut => e => {
const {
onCopy = () => {},
sequenceData,
selectionLayer,
copyOptions
} = this.props;
const onCut = this.props.onCut || this.props.onCopy || (() => {});
const seqData = tidyUpSequenceData(
this.sequenceDataToCopy ||
getSequenceDataBetweenRange(sequenceData, selectionLayer, {
excludePartial: {
features: !copyOptions.partialFeatures,
parts: !copyOptions.partialParts
},
exclude: {
features: !copyOptions.features,
parts: !copyOptions.parts
}
}),
{ annotationsAsObjects: true }
);
if (!seqData.sequence.length)
return window.toastr.warning(
`No Sequence Selected To ${isCut ? "Cut" : "Copy"}`
);