calipho-sib / sequence-viewer

neXtProt protein sequence viewer (javascript) - From SIB CALIPHO group; neXtProt project
https://cdn.rawgit.com/calipho-sib/sequence-viewer/master/examples/index.html
50 stars 18 forks source link

[Enhancement] How to fraction 9bp string and white space sperator when wrapAminoAcids is true ?? #10

Open cdtiwari opened 7 years ago

cdtiwari commented 7 years ago

Hi Team,

I was trying out to make fragment of 9 base pair instead of 10 when wrapAminoAcids is set to true. Below is my code, while applying this code with coverage feature the view of seq-viewer is breaking. dist/sequence-viewer.js

function sequenceLayout(textAreaID) {
            var newLines = parseInt($(textAreaID).attr("display-option"));
            newLines = ( 1 + newLines + (newLines / 10)).toString();
            var seqFormat = $(textAreaID).html();
            seqFormat = seqFormat.toString().match(/.{1,9}/g).join(' ').match(new RegExp('.{1,' + newLines + '}', 'g')).join('<br>');
            seqCustomized = seqFormat;
            $(textAreaID).html(seqFormat);
        }

Please help, how can i achieve this. VYPPIYPVK H$&FKLKAG NDNLIMSGE LREVYPPIY PVKH$&FKL KAGNDNLIM SGELREREV YPPIYPVKH $&FKLKAGN DNLIMSGEL