Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleReverseComplementSelection: props => () => {
const {
sequenceData,
updateSequenceData,
wrappedInsertSequenceDataAtPositionOrRange,
selectionLayer
} = props;
if (!(selectionLayer.start > -1)) {
return; //return early
}
const reversedSeqData = getReverseComplementSequenceAndAnnotations(
sequenceData,
{
range: selectionLayer
}
);
const [newSeqData] = wrappedInsertSequenceDataAtPositionOrRange(
reversedSeqData,
sequenceData,
selectionLayer,
{
maintainOriginSplit: true
}
);
updateSequenceData(newSeqData);
},
selectedSeqData => ({
sequence: getAminoAcidStringFromSequenceString(
getReverseComplementSequenceAndAnnotations(
selectedSeqData
).sequence
)
}),
className
function addDashesForMatchStartAndEnd(
{ alignmentData, sequenceData: _sequenceData },
template,
isTemplate
) {
let sequenceData =_sequenceData
const {
sequenceData: sequenceDataTemplate,
alignmentData: alignmentDataTemplate
} = template;
let { matchStart = 0, matchEnd = 0, strand } = alignmentData;
if (strand === -1) {
sequenceData= getReverseComplementSequenceAndAnnotations(sequenceData)
const oldMatchEnd = matchEnd
matchEnd = matchStart
matchStart = oldMatchEnd
}
const {
matchStart: matchStartTemplate = 0,
matchEnd: matchEndTemplate = 0
} = alignmentDataTemplate;
let newAlignmentData;
if (isTemplate) {
newAlignmentData = {
...alignmentData,
sequence:
sequenceDataTemplate.sequence.slice(0, matchStartTemplate) +
alignmentData.sequence +
sequenceDataTemplate.sequence.slice(matchEndTemplate + 1)
handleReverseComplementSequence: props => () => {
const { sequenceData, updateSequenceData } = props;
updateSequenceData(
getReverseComplementSequenceAndAnnotations(sequenceData)
);
window.toastr.success("Reverse Complemented Sequence Successfully");
},