def test_0060_upload_file( self ):
        """
        Test uploading pbed composite datatype file, manually setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        # pbed data types include a bim_file, a bed_file and a fam_file
        self.upload_file( None, ftype='pbed',
            metadata=[ { 'name': 'base_name', 'value': 'rgenetics' } ],
            composite_data=[
                { 'name': 'bim_file', 'value': 'tinywga.bim' },
                { 'name': 'bed_file', 'value': 'tinywga.bed' },
                { 'name': 'fam_file', 'value': 'tinywga.fam' } ])
        # Get the latest hid for testing
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        # We'll test against the resulting ped file and map file for correctness
        self.verify_composite_datatype_file_content( 'tinywga.bim', str( hda.id ), base_name='rgenetics.bim' )
        self.verify_composite_datatype_file_content( 'tinywga.bed', str( hda.id ), base_name='rgenetics.bed' )
        self.verify_composite_datatype_file_content( 'tinywga.fam', str( hda.id ), base_name='rgenetics.fam' )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "metadata_base_name", "rgenetics", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0105_upload_file(self):
        """
        Test uploading 1.interval, NOT setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history(admin_user)

        self.upload_file('1.interval')
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness('1.interval', hid=str(hda.hid))
        self.check_hda_json_for_key_value(self.security.encode_id(hda.id),
                                          "data_type", "interval")
        self.check_metadata_for_string('value="1.interval" value="\?"')
        self.check_metadata_for_string(
            'Chrom column: <option value="1" selected> Start column: <option value="2" selected>'
        )
        self.check_metadata_for_string(
            'End column: <option value="3" selected> Strand column <option value="6" selected>'
        )
        self.check_metadata_for_string(
            'Convert to new format <option value="bed">Convert Genomic Intervals To BED'
        )
        self.check_metadata_for_string(
            'Change data type selected value="interval" selected="yes"')

        self.delete_history(id=self.security.encode_id(history.id))
    def test_0060_upload_file( self ):
        """
        Test uploading pbed composite datatype file, manually setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        # pbed data types include a bim_file, a bed_file and a fam_file
        self.upload_file( None, ftype='pbed',
            metadata=[ { 'name':'base_name', 'value':'rgenetics' } ],
            composite_data=[
                { 'name':'bim_file', 'value':'tinywga.bim' },
                { 'name':'bed_file', 'value':'tinywga.bed' },
                { 'name':'fam_file', 'value':'tinywga.fam' } ])
        # Get the latest hid for testing
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        # We'll test against the resulting ped file and map file for correctness
        self.verify_composite_datatype_file_content( 'tinywga.bim', str( hda.id ), base_name='rgenetics.bim' )
        self.verify_composite_datatype_file_content( 'tinywga.bed', str( hda.id ), base_name='rgenetics.bed' )
        self.verify_composite_datatype_file_content( 'tinywga.fam', str( hda.id ), base_name='rgenetics.fam' )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "metadata_base_name", "rgenetics", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
 def test_0015_report_dataset_error( self ):
     '''Load and submit the report error form. This should show an error message, as the functional test instance should not be configured for email.'''
     hda = test_db_util.get_latest_hda()
     self.visit_url( '/dataset/errors?id=%s' % self.security.encode_id( hda.hid ) )
     self.check_for_strings( strings_displayed=[ 'Report this error', 'Your email' ] )
     self.submit_form( button='submit_error_report', email='*****@*****.**', message='This tool completed successfully, disregard.' )
     self.check_for_strings( strings_displayed=[ 'Mail is not configured' ] )
Beispiel #5
0
 def test_010_add_tag_to_history_item( self ):
     """Testing adding a tag to a history item"""
     # Logged in as admin_user
     self.upload_file( '1.bed' )
     latest_hda = get_latest_hda()
     self.add_tag( self.security.encode_id( latest_hda.id ),
                   'HistoryDatasetAssociation',
                   'edit_attributes.mako',
                   'goodbye' )
     self.check_hda_attribute_info( 'tags : {"goodbye"' )
 def test_100_add_ldda_to_folder3(self):
     """
     Testing adding a new library dataset to library3's folder, making sure the SelectField setting is correct on the upload form.
     """
     filename = '3.bed'
     ldda_message = '3.bed message'
     # Logged in as admin_user
     self.upload_library_dataset(
         cntrller='library_admin',
         library_id=self.security.encode_id(library3.id),
         folder_id=self.security.encode_id(folder3.id),
         filename=filename,
         file_type='bed',
         dbkey='hg18',
         ldda_message=ldda_message,
         strings_displayed=['SelectField', 'selected>Option1'])
     ldda = get_latest_ldda_by_name(filename)
     assert ldda is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda from the database'
     self.browse_library(cntrller='library_admin',
                         library_id=self.security.encode_id(library3.id),
                         strings_displayed=[ldda.name, ldda.message, 'bed'])
     # Make sure the library template contents were correctly saved
     self.ldda_edit_info('library_admin',
                         self.security.encode_id(library3.id),
                         self.security.encode_id(folder3.id),
                         self.security.encode_id(ldda.id),
                         ldda.name,
                         strings_displayed=['SelectField', 'Option1'])
     # Import a dataset from the current history
     filename = '8.bed'
     self.new_history(name='import+with+SelectField')
     self.upload_file(filename)
     hda = get_latest_hda()
     self.upload_library_dataset(
         cntrller='library_admin',
         library_id=self.security.encode_id(library3.id),
         folder_id=self.security.encode_id(folder3.id),
         upload_option='import_from_history',
         hda_ids=self.security.encode_id(hda.id),
         strings_displayed=[
             '<select name="%s" last_selected_value="Option1">' %
             select_field_name
         ])
     ldda = get_latest_ldda_by_name(filename)
     assert ldda is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda from the database'
     self.browse_library(cntrller='library_admin',
                         library_id=self.security.encode_id(library3.id),
                         strings_displayed=[ldda.name, 'bed'])
     # Make sure the library template contents were correctly saved
     self.ldda_edit_info('library_admin',
                         self.security.encode_id(library3.id),
                         self.security.encode_id(folder3.id),
                         self.security.encode_id(ldda.id),
                         ldda.name,
                         strings_displayed=['SelectField', 'Option1'])
 def check_edit_page( lddas, strings_displayed=[], strings_not_displayed=[] ):
     for ldda in lddas:
         # Import each library dataset into our history
         self.import_datasets_to_histories( cntrller='library',
                                            library_id=self.security.encode_id( library1.id ),
                                            ldda_ids=self.security.encode_id( ldda.id ),
                                            new_history_name='hello' )
         # Determine the new HistoryDatasetAssociation id created when the library dataset was imported into our history
         last_hda_created = get_latest_hda()
         self.edit_hda_attribute_info( str( last_hda_created.id ),
                                       strings_displayed=strings_displayed )
Beispiel #8
0
 def test_0015_report_dataset_error(self):
     '''Load and submit the report error form. This should show an error message, as the functional test instance should not be configured for email.'''
     hda = test_db_util.get_latest_hda()
     self.visit_url('/dataset/errors?id=%s' %
                    self.security.encode_id(hda.hid))
     self.check_for_strings(
         strings_displayed=['Report this error', 'Your email'])
     self.submit_form(
         button='submit_error_report',
         email='*****@*****.**',
         message='This tool completed successfully, disregard.')
     self.check_for_strings(strings_displayed=['Mail is not configured'])
    def test_0050_upload_file( self ):
        """
        Test uploading 454Score.png, NOT setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '454Score.png' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "name", "454Score.png" )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0020_upload_file( self ):
        """
        Test uploading 1.scf, NOT setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '1.scf' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "misc_info", "File Format' to 'Scf' when uploading scf files", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0006_upload_file( self ):
        """
        Test uploading 1.bed.spaces, with space to tab selected, NOT setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '1.bed.spaces', space_to_tab=True )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '1.bed', hid=str( hda.hid ) )
        self.check_history_for_string( "<th>1.Chrom</th><th>2.Start</th><th>3.End</th>" )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0006_upload_file( self ):
        """
        Test uploading 1.bed.spaces, with space to tab selected, NOT setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '1.bed.spaces', space_to_tab=True )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '1.bed', hid=str( hda.hid ) )
        self.check_history_for_string( "<th>1.Chrom</th><th>2.Start</th><th>3.End</th>" )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0020_upload_file( self ):
        """
        Test uploading 1.scf, NOT setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '1.scf' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "misc_info", "File Format' to 'Scf' when uploading scf files", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0050_upload_file(self):
        """
        Test uploading 454Score.png, NOT setting the file format
        """
        history = self.create_fresh_history(admin_user)

        self.upload_file('454Score.png')
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.check_hda_json_for_key_value(self.security.encode_id(hda.id),
                                          "name", "454Score.png")

        self.delete_history(id=self.security.encode_id(history.id))
    def test_0015_upload_file( self ):
        """
        Test uploading 1.scf, manually setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '1.scf', ftype='scf' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '1.scf', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "peek", "Binary scf sequence file", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0175_upload_file( self ):
        """
        Test uploading 1.bigwig, NOT setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '1.bigwig' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '1.bigwig', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ), "data_type", "bigwig" )
        self.check_metadata_for_string( 'value="1.bigwig" value="\?" Change data type selected value="bigwig" selected="yes"' )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0010_upload_file( self ):
        """
        Test uploading 4.bed.gz, manually setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '4.bed.gz', dbkey='hg17', ftype='bed' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '4.bed', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "peek", "<th>1.Chrom</th><th>2.Start</th><th>3.End</th>", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0040_upload_file( self ):
        """
        Test uploading 1.sff, NOT setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '1.sff' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '1.sff', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "misc_info", "sff", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0070_upload_file( self ):
        """
        Test uploading 2gen.fastq, NOT setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        self.upload_file( '2gen.fastq' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '2gen.fastq', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ), "data_type", "fastq" )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0035_upload_file( self ):
        """
        Test uploading 1.sam NOT setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '1.sam' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '1.sam', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "peek", "<th>1.QNAME</th><th>2.FLAG</th><th>3.RNAME</th><th>4.POS</th>", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0115_upload_file( self ):
        """
        Test uploading html_file.txt, NOT setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        self.upload_file( 'html_file.txt' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "misc_info", "The uploaded file contains inappropriate HTML content", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0035_upload_file( self ):
        """
        Test uploading 1.sam NOT setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '1.sam' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '1.sam', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "peek", "<th>1.QNAME</th><th>2.FLAG</th><th>3.RNAME</th><th>4.POS</th>", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0010_upload_file( self ):
        """
        Test uploading 4.bed.gz, manually setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '4.bed.gz', dbkey='hg17', ftype='bed' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '4.bed', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "peek", "<th>1.Chrom</th><th>2.Start</th><th>3.End</th>", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0070_upload_file( self ):
        """
        Test uploading 2gen.fastq, NOT setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        self.upload_file( '2gen.fastq' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '2gen.fastq', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ), "data_type", "fastq" )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0175_upload_file( self ):
        """
        Test uploading 1.bigwig, NOT setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '1.bigwig' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '1.bigwig', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ), "data_type", "bigwig" )
        self.check_metadata_for_string( 'value="1.bigwig" value="\?" Change data type selected value="bigwig" selected="yes"' )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0015_upload_file( self ):
        """
        Test uploading 1.scf, manually setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '1.scf', ftype='scf' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '1.scf', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "peek", "Binary scf sequence file", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0040_upload_file( self ):
        """
        Test uploading 1.sff, NOT setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '1.sff' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '1.sff', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "misc_info", "sff", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
 def test_100_add_ldda_to_folder3( self ):
     """
     Testing adding a new library dataset to library3's folder, making sure the SelectField setting is correct on the upload form.
     """
     filename = '3.bed'
     ldda_message = '3.bed message'
     # Logged in as admin_user
     self.upload_library_dataset( cntrller='library_admin',
                                  library_id=self.security.encode_id( library3.id ),
                                  folder_id=self.security.encode_id( folder3.id ),
                                  filename=filename,
                                  file_type='bed',
                                  dbkey='hg18',
                                  ldda_message=ldda_message,
                                  strings_displayed=[ 'SelectField', 'selected>Option1' ] )
     ldda = get_latest_ldda_by_name( filename )
     assert ldda is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda from the database'
     self.browse_library( cntrller='library_admin',
                          library_id=self.security.encode_id( library3.id ),
                          strings_displayed=[ ldda.name, ldda.message, 'bed' ] )
     # Make sure the library template contents were correctly saved
     self.ldda_edit_info( 'library_admin',
                          self.security.encode_id( library3.id ),
                          self.security.encode_id( folder3.id ),
                          self.security.encode_id( ldda.id ),
                          ldda.name,
                          strings_displayed=[ 'SelectField', 'Option1' ] )
     # Import a dataset from the current history
     filename = '8.bed'
     self.new_history( name='import+with+SelectField' )
     self.upload_file( filename )
     hda = get_latest_hda()
     self.upload_library_dataset( cntrller='library_admin',
                                  library_id=self.security.encode_id( library3.id ),
                                  folder_id=self.security.encode_id( folder3.id ),
                                  upload_option='import_from_history',
                                  hda_ids=self.security.encode_id( hda.id ),
                                  strings_displayed=[ '<select name="%s" last_selected_value="Option1">' % select_field_name ] )
     ldda = get_latest_ldda_by_name( filename )
     assert ldda is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda from the database'
     self.browse_library( cntrller='library_admin',
                          library_id=self.security.encode_id( library3.id ),
                          strings_displayed=[ ldda.name, 'bed' ] )
     # Make sure the library template contents were correctly saved
     self.ldda_edit_info( 'library_admin',
                          self.security.encode_id( library3.id ),
                          self.security.encode_id( folder3.id ),
                          self.security.encode_id( ldda.id ),
                          ldda.name,
                          strings_displayed=[ 'SelectField', 'Option1' ] )
    def test_0115_upload_file( self ):
        """
        Test uploading html_file.txt, NOT setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        self.upload_file( 'html_file.txt' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "misc_info", "The uploaded file contains inappropriate HTML content", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0150_upload_file( self ):
        """
        Test uploading 1.bam, which is a sorted Bam file creaed by the Galaxy sam_to_bam tool, NOT setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '1.bam' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '1.bam', hid=str( hda.hid ), attributes={ 'ftype' : 'bam' } )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ), "data_type", "bam" )
        # Make sure the Bam index was created
        assert hda.metadata.bam_index is not None, "Bam index was not correctly created for 1.bam"

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0135_upload_file( self ):
        """
        Test uploading shrimp_cs_test1.csfasta, NOT setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        self.upload_file( 'shrimp_cs_test1.csfasta' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( 'shrimp_cs_test1.csfasta', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ), "data_type", "csfasta" )
        self.check_metadata_for_string( 'value="shrimp_cs_test1.csfasta" value="\?" Change data type value="csfasta" selected="yes"' )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0135_upload_file( self ):
        """
        Test uploading shrimp_cs_test1.csfasta, NOT setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        self.upload_file( 'shrimp_cs_test1.csfasta' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( 'shrimp_cs_test1.csfasta', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ), "data_type", "csfasta" )
        self.check_metadata_for_string( 'value="shrimp_cs_test1.csfasta" value="\?" Change data type value="csfasta" selected="yes"' )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0065_upload_file( self ):
        """
        Test uploading asian_chars_1.txt, NOT setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        self.upload_file( 'asian_chars_1.txt' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( 'asian_chars_1.txt', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "misc_info", "uploaded multi-byte char file", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0090_upload_file( self ):
        """
        Test uploading qualscores.qual454, NOT setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        self.upload_file( 'qualscores.qual454' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( 'qualscores.qual454', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ), "data_type", "qual454" )
        self.check_metadata_for_string( 'Change data type value="qual454" selected="yes">qual454' )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0150_upload_file( self ):
        """
        Test uploading 1.bam, which is a sorted Bam file creaed by the Galaxy sam_to_bam tool, NOT setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '1.bam' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '1.bam', hid=str( hda.hid ), attributes={ 'ftype' : 'bam' } )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ), "data_type", "bam" )
        # Make sure the Bam index was created
        assert hda.metadata.bam_index is not None, "Bam index was not correctly created for 1.bam"

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0090_upload_file( self ):
        """
        Test uploading qualscores.qual454, NOT setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        self.upload_file( 'qualscores.qual454' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( 'qualscores.qual454', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ), "data_type", "qual454" )
        self.check_metadata_for_string( 'Change data type value="qual454" selected="yes">qual454' )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0065_upload_file( self ):
        """
        Test uploading asian_chars_1.txt, NOT setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        self.upload_file( 'asian_chars_1.txt' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( 'asian_chars_1.txt', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "misc_info", "uploaded multi-byte char file", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0110_upload_file( self ):
        """
        Test uploading 5.gff3, NOT setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        self.upload_file( '5.gff3' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '5.gff3', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ), "data_type", "gff3" )
        self.check_metadata_for_string( 'value="5.gff3" value="\?"' )
        self.check_metadata_for_string( 'Convert to new format <option value="bed">Convert GFF to BED' )
        self.check_metadata_for_string( 'Change data type selected value="gff3" selected="yes"' )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0110_upload_file( self ):
        """
        Test uploading 5.gff3, NOT setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        self.upload_file( '5.gff3' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '5.gff3', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ), "data_type", "gff3" )
        self.check_metadata_for_string( 'value="5.gff3" value="\?"' )
        self.check_metadata_for_string( 'Convert to new format <option value="bed">Convert GFF to BED' )
        self.check_metadata_for_string( 'Change data type selected value="gff3" selected="yes"' )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0095_upload_file( self ):
        """
        Test uploading 3.maf, NOT setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        self.upload_file( '3.maf' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '3.maf', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ), "data_type", "maf" )
        self.check_metadata_for_string( 'value="3.maf" value="\?"' )
        self.check_metadata_for_string( 'Convert to new format <option value="interval">Convert MAF to Genomic Intervals <option value="fasta">Convert MAF to Fasta' )
        self.check_metadata_for_string( 'Change data type selected value="maf" selected="yes"' )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0095_upload_file( self ):
        """
        Test uploading 3.maf, NOT setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        self.upload_file( '3.maf' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '3.maf', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ), "data_type", "maf" )
        self.check_metadata_for_string( 'value="3.maf" value="\?"' )
        self.check_metadata_for_string( 'Convert to new format <option value="interval">Convert MAF to Genomic Intervals <option value="fasta">Convert MAF to Fasta' )
        self.check_metadata_for_string( 'Change data type selected value="maf" selected="yes"' )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0155_upload_file( self ):
        """
        Test uploading 3unsorted.bam, which is an unsorted Bam file, NOT setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '3unsorted.bam' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        # Since 3unsorted.bam is not sorted, we cannot verify dataset correctness since the uploaded
        # dataset will be sorted.  However, the check below to see if the index was created is
        # sufficient.
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ), "data_type", "bam" )
        # Make sure the Bam index was created
        assert hda.metadata.bam_index is not None, "Bam index was not correctly created for 3unsorted.bam"

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0155_upload_file( self ):
        """
        Test uploading 3unsorted.bam, which is an unsorted Bam file, NOT setting the file format
        """
        history = self.create_fresh_history( admin_user )

        self.upload_file( '3unsorted.bam' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        # Since 3unsorted.bam is not sorted, we cannot verify dataset correctness since the uploaded
        # dataset will be sorted.  However, the check below to see if the index was created is
        # sufficient.
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ), "data_type", "bam" )
        # Make sure the Bam index was created
        assert hda.metadata.bam_index is not None, "Bam index was not correctly created for 3unsorted.bam"

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0056_upload_file( self ):
        """
        Test uploading lped composite datatype file, manually setting the file format, and using space to tab on one file (tinywga.ped)
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        # lped data types include a ped_file and a map_file ( which is binary )
        self.upload_file( None, ftype='lped', metadata=[ { 'name':'base_name', 'value':'rgenetics' } ], composite_data=[ { 'name':'ped_file', 'value':'tinywga.ped', 'space_to_tab':True }, { 'name':'map_file', 'value':'tinywga.map'} ] )
        # Get the latest hid for testing
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        # We'll test against the resulting ped file and map file for correctness
        self.verify_composite_datatype_file_content( 'tinywga.ped.space_to_tab', str( hda.id ), base_name='rgenetics.ped' )
        self.verify_composite_datatype_file_content( 'tinywga.map', str( hda.id ), base_name='rgenetics.map' )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "metadata_base_name", "rgenetics", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0105_upload_file( self ):
        """
        Test uploading 1.interval, NOT setting the file format
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        self.upload_file( '1.interval' )
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        self.verify_dataset_correctness( '1.interval', hid=str( hda.hid ) )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ), "data_type", "interval" )
        self.check_metadata_for_string( 'value="1.interval" value="\?"' )
        self.check_metadata_for_string( 'Chrom column: <option value="1" selected> Start column: <option value="2" selected>' )
        self.check_metadata_for_string( 'End column: <option value="3" selected> Strand column <option value="6" selected>' )
        self.check_metadata_for_string( 'Convert to new format <option value="bed">Convert Genomic Intervals To BED' )
        self.check_metadata_for_string( 'Change data type selected value="interval" selected="yes"' )

        self.delete_history( id=self.security.encode_id( history.id ) )
    def test_0056_upload_file( self ):
        """
        Test uploading lped composite datatype file, manually setting the file format, and using space to tab on one file (tinywga.ped)
        """
        # Logged in as admin_user
        history = self.create_fresh_history( admin_user )

        # lped data types include a ped_file and a map_file ( which is binary )
        self.upload_file( None, ftype='lped', metadata=[ { 'name': 'base_name', 'value': 'rgenetics' } ], composite_data=[ { 'name': 'ped_file', 'value': 'tinywga.ped', 'space_to_tab': True }, { 'name': 'map_file', 'value': 'tinywga.map'} ] )
        # Get the latest hid for testing
        hda = get_latest_hda()
        assert hda is not None, "Problem retrieving hda from database"
        # We'll test against the resulting ped file and map file for correctness
        self.verify_composite_datatype_file_content( 'tinywga.ped.space_to_tab', str( hda.id ), base_name='rgenetics.ped' )
        self.verify_composite_datatype_file_content( 'tinywga.map', str( hda.id ), base_name='rgenetics.map' )
        self.check_hda_json_for_key_value( self.security.encode_id( hda.id ),
            "metadata_base_name", "rgenetics", use_string_contains=True )

        self.delete_history( id=self.security.encode_id( history.id ) )
Beispiel #47
0
 def test_055_copy_dataset_from_history_to_subfolder(self):
     """Testing copying a dataset from the current history to a subfolder"""
     # logged in as admin_user
     self.new_history()
     filename = '4.bed'
     self.upload_file(filename)
     latest_hda = get_latest_hda()
     self.upload_library_dataset(
         cntrller='library_admin',
         library_id=self.security.encode_id(library1.id),
         folder_id=self.security.encode_id(subfolder1.id),
         upload_option='import_from_history',
         hda_ids=self.security.encode_id(latest_hda.id),
         ldda_message='Imported from history',
         strings_displayed=['Active datasets in your current history'])
     global ldda4
     ldda4 = get_latest_ldda_by_name(filename)
     assert ldda4 is not None, 'Problem retrieving LibraryDatasetDatasetAssociation ldda4 from the database'
     self.browse_library(
         cntrller='library_admin',
         library_id=self.security.encode_id(library1.id),
         strings_displayed=[ldda4.name, ldda4.message, 'bed'])
Beispiel #48
0
 def test_0010_view_dataset_params(self):
     '''Test viewing a dataset's parameters.'''
     hda = test_db_util.get_latest_hda()
     self.visit_url('/datasets/%s/show_params' %
                    self.security.encode_id(hda.hid))
     self.check_for_strings(strings_displayed=['1.bed', 'uploaded'])
 def test_0010_view_dataset_params( self ):
     '''Test viewing a dataset's parameters.'''
     hda = test_db_util.get_latest_hda()
     self.visit_url( '/datasets/%s/show_params' % self.security.encode_id( hda.hid ) )
     self.check_for_strings( strings_displayed=[ '1.bed', 'uploaded' ] )