Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// return {}
// }
getCutsitesFromSequence
]),
cutsites: deriveData([
['cutsitesByName'],
function (cutsitesByName) {
var cutsitesArray = [];
Object.keys(cutsitesByName).forEach(function (key) {
// return cutsitesByName[key]
cutsitesArray = cutsitesArray.concat(cutsitesByName[key]);
});
return cutsitesArray;
}
]),
translationsWithAminoAcids: deriveData([
['sequenceData', 'translations'],
['sequenceData', 'sequence'],
function getTranslationsWithAminoAcids(translations, sequence) {
return translations.map(function(translation) {
var translationWithAminoAcids = assign({}, translation);
var subseq = getSequenceWithinRange(translation, sequence);
translationWithAminoAcids.aminoAcids = getAminoAcidDataForEachBaseOfDna(subseq, translation.forward);
return translationWithAminoAcids;
});
}
]),
sequenceLength: deriveData([
['sequenceData'],
function(sequenceData) {
return sequenceData.sequence ? sequenceData.sequence.length : 0;
}
function(userEnzymeList) {
return userEnzymeList.map(function(enzymeName) {
return enzymeList[enzymeName];
});
}
]),
cutsitesByName: deriveData([
['sequenceData', 'sequence'],
['sequenceData', 'circular'],
['userEnzymes'],
// function (argument) {
// return {}
// }
getCutsitesFromSequence
]),
cutsites: deriveData([
['cutsitesByName'],
function (cutsitesByName) {
var cutsitesArray = [];
Object.keys(cutsitesByName).forEach(function (key) {
// return cutsitesByName[key]
cutsitesArray = cutsitesArray.concat(cutsitesByName[key]);
});
return cutsitesArray;
}
]),
translationsWithAminoAcids: deriveData([
['sequenceData', 'translations'],
['sequenceData', 'sequence'],
function getTranslationsWithAminoAcids(translations, sequence) {
return translations.map(function(translation) {
var translationWithAminoAcids = assign({}, translation);
],
['charWidth'],
function(rowViewDimensionsWidth, charWidth) {
return Math.floor(rowViewDimensionsWidth / charWidth);
}
]),
userEnzymes: deriveData([
['userEnzymeList'],
function(userEnzymeList) {
return userEnzymeList.map(function(enzymeName) {
return enzymeList[enzymeName];
});
}
]),
cutsitesByName: deriveData([
['sequenceData', 'sequence'],
['sequenceData', 'circular'],
['userEnzymes'],
// function (argument) {
// return {}
// }
getCutsitesFromSequence
]),
cutsites: deriveData([
['cutsitesByName'],
function (cutsitesByName) {
var cutsitesArray = [];
Object.keys(cutsitesByName).forEach(function (key) {
// return cutsitesByName[key]
cutsitesArray = cutsitesArray.concat(cutsitesByName[key]);
});
Store.storeName = name
// Instantiates immutable state and saves it to private variable that can be used for setting listeners
Store.prototype.immutable = function(initialState, options = {}) {
if (this.__tree) {
this.__tree.set(initialState)
} else {
this.__tree = new Baobab(
initialState,
angular.extend({}, immutableDefaults, options)
)
}
return this.__tree
}
Store.prototype.monkey = Baobab.monkey
// Attach store definition to the prototype
Object.keys(spec).forEach(function(key) {
Store.prototype[key] = spec[key]
})
return Store
}
it('should be possible to use monkeys.', function() {
const tree = new Baobab(
{
name: 'John',
surname: 'Talbot',
$name: monkey({
cursors: {
value: ['name']
},
get: function(data) {
return data.value;
}
})
},
{asynchronous: false}
);
class Child extends Component {
render() {
return (
<span id="test">
Hello {this.props.name} {this.props.surname}</span>
}
]),
mapViewRowData: deriveData([
['combinedSequenceData'],
['sequenceLength'],
function(sequenceData, sequenceLength) {
return prepareRowData(sequenceData, sequenceLength);
}
]),
circularViewData: deriveData([
['combinedSequenceData'],
function(combinedSequenceData, ) {
return prepareCircularViewData(combinedSequenceData);
}
]),
circularAndLinearTickSpacing: deriveData([
['sequenceLength'],
function(sequenceLength, ) {
var a = Math.ceil(sequenceLength / 100) * 10;
return a
}
]),
totalRows: deriveData([
['rowData'],
function(rowData) {
if (rowData) {
return rowData.length;
}
}
]),
newRandomRowToJumpTo: deriveData([
['totalRows'],
}
]),
circularViewData: deriveData([
['combinedSequenceData'],
function(combinedSequenceData, ) {
return prepareCircularViewData(combinedSequenceData);
}
]),
circularAndLinearTickSpacing: deriveData([
['sequenceLength'],
function(sequenceLength, ) {
var a = Math.ceil(sequenceLength / 100) * 10;
return a
}
]),
totalRows: deriveData([
['rowData'],
function(rowData) {
if (rowData) {
return rowData.length;
}
}
]),
newRandomRowToJumpTo: deriveData([
['totalRows'],
['rowToJumpTo'],
function(totalRows) {
return {
row: Math.floor(totalRows * Math.random())
};
}
]),
findOrfsInPlasmid
]),
combinedSequenceData: deriveData([ //holds usual sequence data, plus orfs, plus parts..
['sequenceData'],
['orfData'],
['translationsWithAminoAcids'],
['cutsites'],
function(sequenceData, orfData, translations, cutsites) {
return assign({}, sequenceData, {
orfs: orfData,
translations: translations,
cutsites: cutsites
});
}
]),
rowData: deriveData([
['combinedSequenceData'],
['bpsPerRow'],
function(sequenceData, bpsPerRow) {
return prepareRowData(sequenceData, bpsPerRow);
}
]),
mapViewRowData: deriveData([
['combinedSequenceData'],
['sequenceLength'],
function(sequenceData, sequenceLength) {
return prepareRowData(sequenceData, sequenceLength);
}
]),
circularViewData: deriveData([
['combinedSequenceData'],
function(combinedSequenceData, ) {
]),
selectedSeqMeltingTemp: deriveData([
['selectedSequenceString'],
function(selectedSequenceString) {
//tnr: we need to actually implement/find an algorithm to calculate melting temp
return selectedSequenceString.length * 10
}
]),
orfData: deriveData([
['sequenceData', 'sequence'],
['sequenceData', 'circular'], //decide on what to call this..
['minimumOrfSize'],
findOrfsInPlasmid
]),
combinedSequenceData: deriveData([ //holds usual sequence data, plus orfs, plus parts..
['sequenceData'],
['orfData'],
['translationsWithAminoAcids'],
['cutsites'],
function(sequenceData, orfData, translations, cutsites) {
return assign({}, sequenceData, {
orfs: orfData,
translations: translations,
cutsites: cutsites
});
}
]),
rowData: deriveData([
['combinedSequenceData'],
['bpsPerRow'],
function(sequenceData, bpsPerRow) {
function getTranslationsWithAminoAcids(translations, sequence) {
return translations.map(function(translation) {
var translationWithAminoAcids = assign({}, translation);
var subseq = getSequenceWithinRange(translation, sequence);
translationWithAminoAcids.aminoAcids = getAminoAcidDataForEachBaseOfDna(subseq, translation.forward);
return translationWithAminoAcids;
});
}
]),
sequenceLength: deriveData([
['sequenceData'],
function(sequenceData) {
return sequenceData.sequence ? sequenceData.sequence.length : 0;
}
]),
mapViewCharWidth: deriveData([
['mapViewDimensions',
'width'
],
['sequenceLength'],
function(mapViewDimensionsWidth, sequenceLength) {
return mapViewDimensionsWidth / sequenceLength;
}
]),
selectedSequenceString: deriveData([
['sequenceData', 'sequence'],
['selectionLayer'],
function(sequence, selectionLayer) {
if (sequence && selectionLayer && selectionLayer.selected) {
return getSequenceWithinRange(selectionLayer, sequence);
} else {
return '';