39

DeviceEditor system clipboard interface specification
DeviceEditor preferentially uses two custom system clipboard formats (“SequenceProviderExternalContext” and “jbei-sequence-xml”, see below) for sequence meta-data transfer between applications. For integration with third-party applications that do not yet support these two custom clipboard formats, DeviceEditor also supports the standard plain-text clipboard format.

Custom clipboard formats

“SequenceProviderExternalContext”

The data added to the clipboard for this format is an object containing key-value pairs with keys “sequence”, “start”, “end”, and “name”. The value stored for “sequence” should be a string that contains the entire plain-text DNA sequence of the source construct (to transfer sequence context, which is important for several downstream processes). The values stored for “start” and “end” indicate the substring interval of the full sequence that is desired for the copied sequence. Start is the beginning index, inclusive, counting from 0; end is the ending index, exclusive, counting from 0. The value stored for “name” is the name of the source sequence.

Here is an example of what this would look like in ActionScript:
var externalContext:Object = {sequence: "ggcagcaaggtctacggcaaggaacagtttttgcggatgcgccagagcatgttccccgatcgc", start: 3, end: 15, name: "signal_pep"};
Clipboard.generalClipboard.setData(“SequenceProviderExternalContext”, externalContext, true);

In this example, the copied sequence would be “agcaaggtctac”.

“jbei-sequence-xml”

This clipboard format consists of the contents of a jbei-seq format sequence file stored as a String. The entire sequence, along with all of its annotations, is stored in the sequence file, even if only a portion of the sequence is explicitly being copied. The purpose of this format is to supplement the “SequenceProviderExternalContext” format with sequence annotations. As such, to use this format, the “SequenceProviderExternalContext” format must also be supplied, in order for DeviceEditor to determine the correct subsequence to be copied.

Here is an example of what this would look like In ActionScript:
var jbeiSequence:String = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" +
   "<seq:seq\n" +
   "    xmlns:seq=\"http://jbei.org/sequence\"\n" +
   "    xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" +
   "    xsi:schemaLocation=\"http://jbei.org/sequence seq.xsd\"\n" +
   ">\n" +
   "<seq:name>signal_pep</seq:name>\n" +
   "<seq:circular>false</seq:circular>\n" +
   "<seq:features>\n" +
   "    <seq:feature>\n" +
   "        <seq:type>CDS</seq:type>\n" +
   "        <seq:location>\n" +
   "            <seq:genbankStart>1</seq:genbankStart>\n" +
   "            <seq:end>63</seq:end>\n" +
   "        </seq:location>\n" +
   "        <seq:complement>false</seq:complement>\n" +
   "        <seq:label>signal_peptide</seq:label>\n" +
   "        <seq:attribute name=\"translation\">GSKVYGKEQFLRMRQSMFPDR</seq:attribute>\n" +
   "    </seq:feature>\n" +
   "</seq:features>\n" +
   "<seq:sequence>GGCAGCAAGGTCTACGGCAAGGAACAGTTTTTGCGGATGCGCCAGAGCATGTTCCCCGATCGC</seq:sequence>\n" +
   "</seq:seq>";                
Clipboard.generalClipboard.setData(“jbei-sequence-xml”, jbeiSequence,  true);

NOTE: Transferring sequence meta-data between disparate Flex applications (e.g. coping from VectorEditor and pasting in to DeviceEditor) with these custom clipboard formats has been verified to work. This has yet to be attempted or verified for any other languages or frameworks.

Standard clipboard formats

Plain-text

DeviceEditor will accept plain text sequence via a paste operation (using the system’s clipboard format for plain-text), but this method will not transfer any sequence context, sequence annotations, or other meta-data.