Changeset 24


Ignore:
Timestamp:
Mar 23, 2011, 1:24:24 PM (13 years ago)
Author:
robert@…
Message:

Improved export of fasta files and added properties to assaysamples

Location:
trunk
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/Config.groovy

    r13 r24  
    5555metagenomics.fileDir = "fileuploads/permanent"
    5656
     57// Filename of the (.fna, .qual and .oligos) files that are exported
     58// Only the part before the extension is mentioned. If you enter "sequences", the exported files will be
     59// sequences.fna, sequences.qual and sequences.oligos
     60metagenomics.exportFilename = "1.TCA.454Reads"
     61
    5762// Path in GSCF that is used after baseURL for adding a new study
    58 gscf.addStudyPath = "/studyWizard/index?jump=create"
     63gscf.addStudyPath = "/simpleWizard"
    5964
    6065grails.project.groupId = appName // change this to alter the default package name and Maven publishing destination
  • trunk/grails-app/conf/config-dbnptest.properties

    r16 r24  
    2525metagenomics.fileUploadDir=/tmp/metagenomics/temp
    2626metagenomics.fileDir=/tmp/metagenomics/permanent
     27
     28# Filename of the (.fna, .qual and .oligos) files that are exported
     29metagenomics.exportFilename=1.TCA.454Reads
  • trunk/grails-app/conf/config-development.properties

    r16 r24  
    2525metagenomics.fileUploadDir=fileuploads/temp
    2626metagenomics.fileDir=fileuploads/permanent
     27
     28# Filename of the (.fna, .qual and .oligos) files that are exported
     29metagenomics.exportFilename=1.TCA.454Reads
  • trunk/grails-app/controllers/nl/tno/metagenomics/AssayController.groovy

    r14 r24  
    209209
    210210                                if( assaySampleParams ) {
    211                                         assaySample.tagName = assaySampleParams.tagName
    212                                         assaySample.oligoNumber = assaySampleParams.oligoNumber
    213                                         assaySample.tagSequence = assaySampleParams.tagSequence
    214 
     211                                        sampleExcelService.variableFields.each { k, v ->
     212                                                assaySample[ k ] = assaySampleParams[ k ];
     213                                        }
     214                                        assaySample.save()
     215                                       
    215216                                        try {
    216217                                                assaySample.run = Run.get( assaySampleParams.run as Long );
     
    331332                response.setHeader "Content-disposition", "attachment; filename=" + name.trim() + ".zip"
    332333                try {
    333                         fastaService.export( assaySamples.unique(), response.getOutputStream(), name );
     334                        fastaService.export( assaySamples.unique(), response.getOutputStream() );
    334335                        response.outputStream.flush();
    335336                } catch( Exception e ) {
  • trunk/grails-app/controllers/nl/tno/metagenomics/RunController.groovy

    r19 r24  
    269269                // Make it only possible to update samples writable by the user
    270270                def assaySamples = run.assaySamples.findAll { it.assay.study.canWrite( session.user ) }
    271 
    272                 println "Matchcolumns: " + matchColumns
    273                 println "Possible fields: " + session.possibleFields
    274                 println "Assay samples: " + assaySamples.sample.name
    275271               
    276272                def excelData = sampleExcelService.updateTagsByExcel( matchColumns, session.possibleFields, file, assaySamples );
     
    315311                                def assaySampleParams = sampleParams.get( assaySample.id as String );
    316312                                if( assaySampleParams ) {
    317                                         assaySample.tagName = assaySampleParams.tagName
    318                                         assaySample.oligoNumber = assaySampleParams.oligoNumber
    319                                         assaySample.tagSequence = assaySampleParams.tagSequence
    320 
     313                                        sampleExcelService.variableFields.each { k, v ->
     314                                                assaySample[ k ] = assaySampleParams[ k ];
     315                                        }
    321316                                        assaySample.save()
    322317                                }
     
    514509                response.setHeader "Content-disposition", "attachment; filename=${name}.zip"
    515510                try {
    516                         fastaService.export( assaySamples.unique(), response.getOutputStream(), name );
     511                        fastaService.export( assaySamples.unique(), response.getOutputStream() );
    517512                        response.outputStream.flush();
    518513                } catch( Exception e ) {
  • trunk/grails-app/controllers/nl/tno/metagenomics/SampleController.groovy

    r14 r24  
    3131           response.setHeader "Content-disposition", "attachment; filename=" + name.trim() + ".zip"
    3232           try {
    33                    fastaService.export( assaySamples.unique(), response.getOutputStream(), name );
     33                   fastaService.export( assaySamples.unique(), response.getOutputStream() );
    3434                   response.outputStream.flush();
    3535           } catch( Exception e ) {
  • trunk/grails-app/controllers/nl/tno/metagenomics/StudyController.groovy

    r14 r24  
    4444                response.setHeader "Content-disposition", "attachment; filename=" + name.trim() + ".zip"
    4545                try {
    46                         fastaService.export( assaySamples.unique(), response.getOutputStream(), name );
     46                        fastaService.export( assaySamples.unique(), response.getOutputStream() );
    4747                        response.outputStream.flush();
    4848                } catch( Exception e ) {
  • trunk/grails-app/domain/nl/tno/metagenomics/AssaySample.groovy

    r20 r24  
    1515        Integer numUniqueSequences      // Number of unique sequences / OTUs. Is only available after preprocessing
    1616
    17         String oligoNumber              // Oligonumber used to identify the sample
    18         String tagSequence              // Tag originally used to identify the sample
    19         String tagName                  // Tag name
     17        String fwOligo
     18        String fwMidName
     19        String fwTotalSeq
     20        String fwMidSeq
     21        String fwPrimerSeq
     22       
     23        String revOligo
     24        String revMidName
     25        String revTotalSeq
     26        String revMidSeq
     27        String revPrimerSeq
    2028
    2129        static belongsTo  = [ assay: Assay, sample: Sample, run: Run ]
     
    2432        static constraints = {
    2533                numUniqueSequences(nullable: true)
    26                 oligoNumber(nullable: true)
    27                
    28                 /*
    29                 , validator: { value, obj, errors ->
    30                         // When one oligoNumber is used in different assaysamples,
    31                         // they must also have the same tagSequences and tagNames
    32                        
    33                         // Check whether this oligoNumber exists in the database
    34                         def otherAssaySamples = AssaySample.findAllByOligoNumber( value )
    35                         if( !otherAssaySamples || otherAssaySamples.size() == 0 ) {
    36                                 return true;
    37                         }
    38                        
    39                         // Loop through the other assaysamples with this oligonumber
    40                         otherAssaySamples.each { otherAS ->
    41                                 // Only check other objects, don't compare with itself (because that
    42                                 // way it wouldn't be possible anymore to edit an object)
    43                                 if( otherAS.id != obj.id ) {
    44                                         if( otherAS.tagSequence != obj.tagSequence || otherAS.tagName != obj.tagName ) {
    45                                                 return false;
    46                                         }
    47                                 }
    48                         }
    49                        
    50                         return true
    51                 }
    52                  */
    53                 tagSequence(nullable: true)
    54                 tagName(nullable:true)
     34                fwOligo(nullable: true)
     35                fwMidName(nullable: true)
     36                fwTotalSeq(nullable:true)
     37                fwMidSeq(nullable:true)
     38                fwPrimerSeq(nullable:true)
     39                revOligo(nullable: true)
     40                revMidName(nullable: true)
     41                revTotalSeq(nullable:true)
     42                revMidSeq(nullable:true)
     43                revPrimerSeq(nullable:true)
    5544                run(nullable: true);
    5645        }
     
    201190         */
    202191        public boolean containsData() {
    203                 return tagSequence || tagName || oligoNumber || numFiles() > 0;
     192                return  fwOligo || fwMidName || fwTotalSeq || fwMidSeq || fwPrimerSeq ||
     193                                revOligo || revMidName || revTotalSeq || revMidSeq || revPrimerSeq ||
     194                                numFiles() > 0;
    204195        }
    205196       
     
    213204        public void moveValuableDataTo( AssaySample otherAssaySample ) {
    214205                // Copy properties
    215                 otherAssaySample.tagSequence = tagSequence;
    216                 otherAssaySample.oligoNumber = oligoNumber;
    217                 otherAssaySample.tagName         = tagName;
     206                otherAssaySample.fwOligo                = fwOligo;
     207                otherAssaySample.fwMidName              = fwMidName;
     208                otherAssaySample.fwTotalSeq     = fwTotalSeq;
     209                otherAssaySample.fwMidSeq               = fwMidSeq;
     210                otherAssaySample.fwPrimerSeq    = fwPrimerSeq;
    218211               
     212                otherAssaySample.revOligo               = revOligo;
     213                otherAssaySample.revMidName             = revMidName;
     214                otherAssaySample.revTotalSeq    = revTotalSeq;
     215                otherAssaySample.revMidSeq              = revMidSeq;
     216                otherAssaySample.revPrimerSeq   = revPrimerSeq;
     217
    219218                // Move attached data
    220219                def dataList = [] + sequenceData?.toList()
  • trunk/grails-app/services/nl/tno/metagenomics/FastaService.groovy

    r13 r24  
    405405         * @return
    406406         */
    407         public def export( List assaySamples, OutputStream outStream, String name ) {
     407        public def export( List assaySamples, OutputStream outStream, String name = null ) {
    408408                if( !assaySamples || assaySamples.size() == 0 )
    409409                        return false;
     410               
     411                // Retrieve the filename from configuration, if none is given
     412                if( !name )
     413                        name = ConfigurationHolder.config.metagenomics.exportFilename
    410414
    411415                // Determine the directory the uploaded files are stored in
     
    421425                // Determine new tag length. Since we can use 4 characters per
    422426                // tag position, we only have to use 4log( #samples)
    423                 int tagLength = Math.ceil( Math.log( assaySamples.size() ) / Math.log( 4 ) )
     427                // The minimum number of characters used is 10, to ensure the correct working of the other
     428                // programs.
     429                int tagLength = Math.max( 10, Math.ceil( Math.log( assaySamples.size() ) / Math.log( 4 ) ) );
    424430                int tagNumber = 0;
    425431
     
    430436
    431437                                // Save the tag for exporting
    432                                 tags << [assaySampleId: assaySample.id, sampleName: assaySample.sample.name, assayName: assaySample.assay.name, studyName: assaySample.assay.study.name, tag: tag]
     438                                tags << [       assaySampleId: assaySample.id, sampleName: assaySample.sample.name,
     439                                                        assayName: assaySample.assay.name, studyName: assaySample.assay.study.name,
     440                                                        forwardPrimer: assaySample.fwPrimerSeq, reversePrimer: assaySample.revPrimerSeq,
     441                                                        tag: tag
     442                                ];
    433443                        }
    434444                }
     
    441451                // file and part of the qual files mixed. We have to write the full sequence file first.
    442452                try {
    443                         zipFile.putNextEntry( new ZipEntry( name + ".fasta" ) );
     453                        zipFile.putNextEntry( new ZipEntry( name + ".fna" ) );
    444454                       
    445455                        assaySamples.each { assaySample ->
     
    484494               
    485495                // Export a tab delimited file with tags
    486                 zipFile.putNextEntry( new ZipEntry( name + "_sample-tag.tab" ) );
    487                 exportSampleTagFile( tags, zipWriter );
     496                zipFile.putNextEntry( new ZipEntry( name + ".tab" ) );
     497                exportTabDelimitedSampleTagFile( tags, zipWriter );
    488498                zipWriter.flush();
    489499                zipFile.closeEntry();
    490500
     501                // Export a mothur file with tags
     502                zipFile.putNextEntry( new ZipEntry( name + ".oligos" ) );
     503                exportMothurSampleTagFile( tags, zipWriter );
     504                zipWriter.flush();
     505                zipFile.closeEntry();
     506               
    491507                // Export an excel file with information about the samples
    492508                zipFile.putNextEntry( new ZipEntry( name + ".xls" ) );
     
    498514       
    499515        /**
    500          * Creates a tab delimited file with two columns and column headers "Sequence" and "Samplename"
     516         * Creates an oligos file for Mothur that represents the connection between samples
     517         * and the artificial tags.
     518         *
     519         * @see http://www.mothur.org/wiki/Trim.seqs#allfiles
    501520         * @param tags          Map with newly created tags
    502521         * @param zipWriter     Writer to write the data to
    503522         */
    504         protected void exportSampleTagFile( List tags, Writer zipWriter ) {
    505                 zipWriter.write( "Sequence" + "\t" + "Samplename" + "\n" );
     523        protected void exportMothurSampleTagFile( List tags, Writer zipWriter ) {
     524                // Add the forward and reverse primers, as found in the assaysamples
     525                // The primers are already cut off, so they are not relevant anymore
     526                // For that reason, a '#' is prepended to each line.
     527                def fwPrimers = tags.collect { it.forwardPrimer }.findAll { it }.unique();
     528                def revPrimers = tags.collect { it.reversePrimer }.findAll { it }.unique();
     529               
     530                fwPrimers.each { zipWriter.write( "#forward\t" + it + "\n" )    }
     531                revPrimers.each { zipWriter.write( "#reverse\t" + it + "\n" ) }
    506532               
    507533                // Check whether the sample names are unique. If they aren't, the assay and study names
     
    519545               
    520546                tags.each {
    521                         zipWriter.write( it.tag + "\t" + it.uniqueName + "\n" );
    522                 }
    523         }
    524 
     547                        zipWriter.write( "barcode\t" + it.tag + "\t" + it.uniqueName + "\n" );
     548                }
     549        }
     550
     551        /**
     552        * Creates a tab delimited file with two columns and column headers "Sequence" and "Samplename"
     553        * @param tags           Map with newly created tags
     554        * @param zipWriter      Writer to write the data to
     555        */
     556   protected void exportTabDelimitedSampleTagFile( List tags, Writer zipWriter ) {
     557           zipWriter.write( "Sequence" + "\t" + "Samplename" + "\n" );
     558           
     559           // Check whether the sample names are unique. If they aren't, the assay and study names
     560           // are appended to the sample name
     561           def sampleNames = tags*.sampleNames;
     562           if( sampleNames.unique().size() < sampleNames.size() ) {
     563                   tags.each {
     564                           it.uniqueName = it.sampleName + " (" + it.assayName + " / " + it.studyName + ")";
     565                   }
     566           } else {
     567                   tags.each {
     568                           it.uniqueName = it.sampleName;
     569                   }
     570           }
     571           
     572           tags.each {
     573                   zipWriter.write( it.tag + "\t" + it.uniqueName + "\n" );
     574           }
     575   }
     576
     577       
    525578        /**
    526579         * Creates a unique tag for the given number
     
    541594                        int currentChar = tagNumber % numChars
    542595
    543                         tag = chars[ currentChar ] + tag;
     596                        // Append the new character to the end of the tag, to ensure that the first part of the tag is
     597                        // the most volatile. This way it is easy to find the end of the tag and the beginning of the real
     598                        // sequence on first sight.
     599                        tag = tag + chars[ currentChar ];
    544600
    545601                        tagNumber = Math.floor( tagNumber / numChars );
    546602                }
    547603
    548                 return tag
     604                return tag;
    549605        }
    550606
  • trunk/grails-app/services/nl/tno/metagenomics/SampleExcelService.groovy

    r21 r24  
    1111
    1212        // Fields to be edited using excel file and manually
     13        def variableFields = [
     14                'fwOligo':              'Forward oligo number',
     15                'fwMidName':    'Forward mid name',
     16                'fwTotalSeq':   'Total forward sequence',
     17                'fwMidSeq':             'Forward mid sequence',
     18                'fwPrimerSeq':  'Forward primer sequence',
     19                'revOligo':     'Reverse oligo number',
     20                'revMidName':   'Reverse mid name',
     21                'revTotalSeq':  'Total reverse sequence',
     22                'revMidSeq':    'Reverse mid sequence',
     23                'revPrimerSeq': 'Reverse primer sequence',
     24
     25        ]
     26       
    1327        def sampleNameName = "Sample name"
    1428        def runName = "Run"
    15         def tagNameName = "Tag name"
    16         def tagSequenceName = "Tag sequence"
    17         def oligoNumberName = "Oligo number"
    18         def possibleFields = [sampleNameName, runName, tagNameName, tagSequenceName, oligoNumberName]
     29        def possibleFields = [sampleNameName, runName] + variableFields.keySet().toList();
     30        def possibleFieldNames = [sampleNameName, runName ] + variableFields.values();
    1931       
    2032    /**
     
    3547                def wb = excelService.create();
    3648
    37                 def fields = possibleFields
     49                def fields = possibleFieldNames
    3850                if( !includeRun )
    3951                        fields = fields - runName
     
    4961                                rowData << assaySample.run?.name
    5062                       
    51                         rowData << assaySample.tagName
    52                         rowData << assaySample.tagSequence
    53                         rowData << assaySample.oligoNumber
     63                        variableFields.each { k, v ->
     64                                rowData << assaySample[ k ];
     65                        }
     66                       
    5467                        data << rowData;
    5568                }
     
    5770
    5871                // Auto resize columns
    59                 excelService.autoSizeColumns( wb, sheetIndex, 0..2)
     72                excelService.autoSizeColumns( wb, sheetIndex, 0..fields.size())
    6073
    6174                return wb;
     
    8295                // Try to guess best matches between the excel file and the column names
    8396                def bestMatches = [:]
    84                 def fields = possibleFields
     97                def fields = possibleFieldNames
    8598                if( !includeRun )
    8699                        fields = fields - runName
    87                
    88100                       
    89101                // Do matching using fuzzy search. The 0.8 treshold makes sure that no match if chosen if
    90102                // there is actually no match at all.
    91                 def matches = fuzzySearchService.mostSimilarUnique( headers, possibleFields, 0.8 );
     103                def matches = fuzzySearchService.mostSimilarUnique( headers, fields, 0.8 );
    92104               
    93105                headers.eachWithIndex { header, idx ->
     
    121133                def columns = [:]
    122134                def dataMatches = false;
    123                 possibleFields.each { columnName ->
     135                possibleFieldNames.each { columnName ->
    124136                        def foundColumn = matchColumns.find { it.value == columnName };
    125137                       
     
    130142                }
    131143
    132                 println columns
    133                
    134144                // A column to match the sample name must be present
    135145                if( columns[ sampleNameName ] == -1 ) {
     
    188198                        columns.each {
    189199                                if( it.value > -1 ) {
    190                                         switch( it.key ) {
    191                                                 case tagNameName:               assaySample.tagName = rowData[ it.value ]; break
    192                                                 case tagSequenceName:   assaySample.tagSequence = rowData[ it.value ]; break
    193                                                 case oligoNumberName:   assaySample.oligoNumber = rowData[ it.value ]; break
    194                                                 case runName:                   assaySample.run = Run.findByName( rowData[ it.value ] ); break
     200                                        if( it.key == runName ) {
     201                                                assaySample.run = Run.findByName( rowData[ it.value ] );
     202                                        } else {
     203                                                def field = variableFields.find { variableField -> variableField.value == it.key };
     204                                                if( field ) {
     205                                                        assaySample[ field.key ] = rowData[ it.value ];
     206                                                }
    195207                                        }
    196208                                }
     
    245257                def subjectFields = []
    246258                def eventFields = []
    247                 def moduleFields = [ "Sample name", "Assay name", "Study name", "Run name", "# sequences", "Artificial tag sequence", "Original tag sequence", "Tag name", "Oligo number" ]
     259                def moduleFields = [ "Sample name", "Assay name", "Study name", "Run name", "# sequences", "Artificial tag sequence" ] + variableFields.values();
    248260                gscfData.each { sample ->
    249261                        sample.each { key, value ->
     
    281293                                assaySample.numSequences(),
    282294                                currentTag?.tag,
    283                                 assaySample.tagName,
    284                                 assaySample.tagSequence,
    285                                 assaySample.oligoNumber
    286295                        ]
     296                       
     297                        // Add the variable fields for all assaysamples
     298                        variableFields.each { k, v ->
     299                                row << assaySample[ k ];
     300                        }
    287301                       
    288302                        // Afterwards add the gscfData including subject and event data
     
    322336                excelService.writeData( wb, data, sheetIndex, 0 );
    323337
    324                 // Auto resize columns
    325                 excelService.autoSizeColumns( wb, sheetIndex, 0..fields[ "names" ][ "all" ].size()-1)
     338                // Auto resize columns (# columns = # samples + 1)
     339                excelService.autoSizeColumns( wb, sheetIndex, 0..assaySamples?.size())
    326340
    327341                // Write the data to the output stream
  • trunk/grails-app/services/nl/tno/metagenomics/files/ExcelService.groovy

    r20 r24  
    185185         * @return
    186186         */
    187         public Workbook autoSizeColumns( Workbook book, int sheetIndex = 0,def columns = 0 ) {
     187        public Workbook autoSizeColumns( Workbook book, int sheetIndex = 0, def columns = 0 ) {
    188188                if( book == null )
    189189                        throw new Exception( "No workbook given." );
  • trunk/grails-app/services/nl/tno/metagenomics/integration/SynchronizationService.groovy

    r16 r24  
    634634                                        // Update the sample object if necessary
    635635                                        sampleFound.name = gscfSample.name
    636                                         sampleFound.subject = gscfSample.subject.toString()
    637                                         sampleFound.event = gscfSample.event.toString() + ( gscfSample.startTime ? " (" + gscfSample.startTime + ")" : "" )
     636                                        setSubjectAndEventFromGSCF( sampleFound, gscfSample );
    638637                                        sampleFound.save();
    639638                                } else {
     
    648647                                                // Update the sample object if necessary
    649648                                                sampleFound.name = gscfSample.name
    650                                                 sampleFound.subject = gscfSample.subject.toString()
    651                                                 sampleFound.event = gscfSample.event.toString() + ( gscfSample.startTime ? " (" + gscfSample.startTime + ")" : "" )
     649                                                setSubjectAndEventFromGSCF( sampleFound, gscfSample );
    652650                                                sampleFound.save();
    653651                                        } else {
     
    656654                                                // If it doesn't exist, create a new object
    657655                                                sampleFound = new Sample( sampleToken: gscfSample.sampleToken, name: gscfSample.name, study: assay.study );
    658                                                 sampleFound.subject = gscfSample.subject.toString()
    659                                                 sampleFound.event = gscfSample.event.toString() + ( gscfSample.startTime ? " (" + gscfSample.startTime + ")" : "" )
     656                                                setSubjectAndEventFromGSCF( sampleFound, gscfSample );
    660657                                                assay.study.addToSamples( sampleFound );
    661658                                                sampleFound.save();
     
    673670                        }
    674671                }
     672        }
     673       
     674        /**
     675         * Copies the subject and event properties from the gscf sample to the local sample
     676         * @param sample                Sample object to update
     677         * @param gscfSample    Map with properties about the gscf sample ('subject', 'event' and 'startTime' are used)
     678         */
     679        private void setSubjectAndEventFromGSCF( sample, gscfSample ) {
     680                sample.subject = gscfSample.subject && gscfSample.subject != "null" ? gscfSample.subject.toString() : ""
     681
     682                sample.event = gscfSample.event && gscfSample.event != "null" ? gscfSample.event.toString() : ""
     683               
     684                if( gscfSample.startTime && gscfSample.startTime != "null" )
     685                        sample.event += " (" + gscfSample.startTime + ")";
    675686        }
    676687
  • trunk/grails-app/views/assay/_enterTagsDialog.gsp

    r9 r24  
    1616                                                        <th>Sample</th>
    1717                                                        <th>Run</th>
    18                                                         <th>Tag name</th>
    19                                                         <th>Tag sequence</th>
     18                                                        <th></th>
    2019                                                        <th>Oligo number</th>
     20                                                        <th>Mid name</th>
     21                                                        <th>Total sequence</th>
     22                                                        <th>Mid sequence</th>
     23                                                        <th>Primer sequence</th>
    2124                                                </tr>
    2225                                        </thead>
     
    2528                                                        <td>${assaySample.sample?.name}</td>
    2629                                                        <td><g:select name="assaySample.${assaySample.id}.run" from="${assaySample.assay.runs}" value="${assaySample.run?.id}" optionKey="id" optionValue="name" /></td>
    27                                                         <td><g:textField name="assaySample.${assaySample.id}.tagName" value="${assaySample.tagName}" /></td>
    28                                                         <td><g:textField name="assaySample.${assaySample.id}.tagSequence" value="${assaySample.tagSequence}" /></td>
    29                                                         <td><g:textField name="assaySample.${assaySample.id}.oligoNumber" value="${assaySample.oligoNumber}" /></td>
     30                                                        <td>fw</td>
     31                                                        <td><g:textField name="assaySample.${assaySample.id}.fwOligo" value="${assaySample.fwOligo}" /></td>
     32                                                        <td><g:textField name="assaySample.${assaySample.id}.fwMidName" value="${assaySample.fwMidName}" /></td>
     33                                                        <td><g:textField name="assaySample.${assaySample.id}.fwTotalSeq" value="${assaySample.fwTotalSeq}" /></td>
     34                                                        <td><g:textField name="assaySample.${assaySample.id}.fwMidSeq" value="${assaySample.fwMidSeq}" /></td>
     35                                                        <td><g:textField name="assaySample.${assaySample.id}.fwPrimerSeq" value="${assaySample.fwPrimerSeq}" /></td>
    3036                                                </tr>
     37                                                <tr>
     38                                                        <td></td>
     39                                                        <td></td>
     40                                                        <td>rev</td>
     41                                                        <td><g:textField name="assaySample.${assaySample.id}.revOligo" value="${assaySample.revOligo}" /></td>
     42                                                        <td><g:textField name="assaySample.${assaySample.id}.revMidName" value="${assaySample.revMidName}" /></td>
     43                                                        <td><g:textField name="assaySample.${assaySample.id}.revTotalSeq" value="${assaySample.revTotalSeq}" /></td>
     44                                                        <td><g:textField name="assaySample.${assaySample.id}.revMidSeq" value="${assaySample.revMidSeq}" /></td>
     45                                                        <td><g:textField name="assaySample.${assaySample.id}.revPrimerSeq" value="${assaySample.revPrimerSeq}" /></td>
     46                                                </tr>                                           
    3147                                        </g:each>
    3248                                </table>
  • trunk/grails-app/views/assay/show.gsp

    r21 r24  
    6767                                        <th nowrap>name</th>
    6868                                        <th nowrap>run</th>
    69                                         <th nowrap>tag name</th>
    70                                         <th nowrap>tag sequence</th>
     69                                        <th nowrap>forward mid</th>
    7170                                        <th nowrap># sequences</th>
    7271                                        <th nowrap># qual</th>
     
    7978                                                <td><a href="#" onClick="showSample(${assaySample.id}, 'assay'); return false;">${assaySample.sample.name}</a></td>
    8079                                                <td>${assaySample.run?.name}</td>
    81                                                 <td>${assaySample.tagName}</td>
    82                                                 <td>${assaySample.tagSequence}</td>
     80                                                <td>${assaySample.fwMidName}</td>
    8381                                                <td>
    8482                                                        <g:if test="${assaySample.numSequenceFiles() > 0}">
  • trunk/grails-app/views/assaySample/show.gsp

    r9 r24  
    1111
    1212<h2>Details</h2>
     13<ul class="assaySampleDetails">
     14        <li class="title">
     15                <label>&nbsp;</label>
     16                <span class="value">forward</span>
     17                <span class="value">reverse</span>
     18        </li>
     19        <li>
     20                <label>Oligo number</label>
     21                <span class="value">${assaySample.fwOligo}</span>
     22                <span class="value">${assaySample.revOligo}</span>
     23        </li>
     24        <li>
     25                <label>Mid name</label>
     26                <span class="value">${assaySample.fwMidName}</span>
     27                <span class="value">${assaySample.revMidName}</span>
     28        </li>
     29        <li>
     30                <label>Total sequence</label>
     31                <span class="value">${assaySample.fwTotalSeq}</span>
     32                <span class="value">${assaySample.revTotalSeq}</span>
     33        </li>
     34        <li>
     35                <label>Mid sequence</label>
     36                <span class="value">${assaySample.fwMidSeq}</span>
     37                <span class="value">${assaySample.revMidSeq}</span>
     38        </li>
     39        <li>
     40                <label>Primer sequence</label>
     41                <span class="value">${assaySample.fwPrimerSeq}</span>
     42                <span class="value">${assaySample.revPrimerSeq}</span>
     43        </li>
     44</ul>
    1345
     46<h2>Statistics</h2>
    1447<ul>
    15         <li><label>Tag name</label><span class="value">${assaySample.tagName}</span></li>
    16         <li><label>Tag sequence</label><span class="value">${assaySample.tagSequence}</span></li>
    17         <li><label>Oligo number</label><span class="value">${assaySample.oligoNumber}</span></li>
    1848        <li><label># sequences</label><span class="value">${assaySample.numSequences() ?: '-'}</span></li>
    1949        <li><label># unique sequences</label><span class="value">${assaySample.numUniqueSequences ?: '-'}</span></li>
  • trunk/grails-app/views/run/_enterTagsDialog.gsp

    r9 r24  
    1515                                                <tr>
    1616                                                        <th>Sample</th>
    17                                                         <th>Tag name</th>
    18                                                         <th>Tag sequence</th>
     17                                                        <th></th>
    1918                                                        <th>Oligo number</th>
     19                                                        <th>Mid name</th>
     20                                                        <th>Total sequence</th>
     21                                                        <th>Mid sequence</th>
     22                                                        <th>Primer sequence</th>
    2023                                                </tr>
    2124                                        </thead>
     
    2326                                                <tr>
    2427                                                        <td>${assaySample.sample?.name}</td>
    25                                                         <td><g:textField name="assaySample.${assaySample.id}.tagName" value="${assaySample.tagName}" /></td>
    26                                                         <td><g:textField name="assaySample.${assaySample.id}.tagSequence" value="${assaySample.tagSequence}" /></td>
    27                                                         <td><g:textField name="assaySample.${assaySample.id}.oligoNumber" value="${assaySample.oligoNumber}" /></td>
     28                                                        <td>fw</td>
     29                                                        <td><g:textField name="assaySample.${assaySample.id}.fwOligo" value="${assaySample.fwOligo}" /></td>
     30                                                        <td><g:textField name="assaySample.${assaySample.id}.fwMidName" value="${assaySample.fwMidName}" /></td>
     31                                                        <td><g:textField name="assaySample.${assaySample.id}.fwTotalSeq" value="${assaySample.fwTotalSeq}" /></td>
     32                                                        <td><g:textField name="assaySample.${assaySample.id}.fwMidSeq" value="${assaySample.fwMidSeq}" /></td>
     33                                                        <td><g:textField name="assaySample.${assaySample.id}.fwPrimerSeq" value="${assaySample.fwPrimerSeq}" /></td>
     34                                                </tr>
     35                                                <tr>
     36                                                        <td></td>
     37                                                        <td>rev</td>
     38                                                        <td><g:textField name="assaySample.${assaySample.id}.revOligo" value="${assaySample.revOligo}" /></td>
     39                                                        <td><g:textField name="assaySample.${assaySample.id}.revMidName" value="${assaySample.revMidName}" /></td>
     40                                                        <td><g:textField name="assaySample.${assaySample.id}.revTotalSeq" value="${assaySample.revTotalSeq}" /></td>
     41                                                        <td><g:textField name="assaySample.${assaySample.id}.revMidSeq" value="${assaySample.revMidSeq}" /></td>
     42                                                        <td><g:textField name="assaySample.${assaySample.id}.revPrimerSeq" value="${assaySample.revPrimerSeq}" /></td>
    2843                                                </tr>
    2944                                        </g:each>
  • trunk/grails-app/views/run/show.gsp

    r21 r24  
    9696                                        <th nowrap>study</th>
    9797                                        <th nowrap>assay</th>
    98                                         <th nowrap>tag name</th>
    99                                         <th nowrap>tag sequence</th>
     98                                        <th nowrap>Forward mid</th>
    10099                                        <th nowrap># sequences</th>
    101100                                        <th nowrap># qual</th>
     
    109108                                                <td>${assaySample.assay.study.name}</td>
    110109                                                <td>${assaySample.assay.name}</td>
    111                                                 <td>${assaySample.tagName}</td>
    112                                                 <td>${assaySample.tagSequence}</td>
     110                                                <td>${assaySample.fwMidName}</td>
    113111                                                <td>
    114112                                                        <g:if test="${assaySample.numSequenceFiles() > 0}">
  • trunk/web-app/css/metagenomics.css

    r15 r24  
    490490}
    491491
     492.ui-dialog .assaySampleDetails li.title { border-bottom: 1px solid #666; }
     493#showSampleDialog ul.assaySampleDetails li { padding: 0 3px; margin: 0; }
     494.ui-dialog .assaySampleDetails li label, .ui-dialog .assaySampleDetails li span { padding: 3px 0; }
     495.ui-dialog .assaySampleDetails label { border-right: 1px solid #666; }
     496.ui-dialog .assaySampleDetails span.value { width: 150px; display: inline-block; *display: inline; zoom: 1; }
     497
    492498/* Makes sure the filenames in the dialog don't exceed 200px */
    493499.dataTables_wrapper .uploadedFile { display: inline-block; zoom: 1; *display: inline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 190px; height: 15px; }
  • trunk/web-app/js/enterTagsDialog.js

    r21 r24  
    22        $( "#enterTagsDialog" ).tabbedDialog({
    33                height: 450,
    4                 width: 750,
     4                width: 960,
    55                modal: true,
    66                autoOpen: false,
Note: See TracChangeset for help on using the changeset viewer.