CRBanim App

The crbanim application models the data import from CRBanim files

crbanim.helpers

crbanim.helpers module contents

Created on Thu Feb 21 15:37:16 2019

@author: Paolo Cozzi <cozzi@ibba.cnr.it>

exception crbanim.helpers.CRBAnimImportError[source]

Bases: Exception

class crbanim.helpers.CRBAnimReader[source]

Bases: uid.helpers.FileDataSourceMixin

__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

check_countries()[source]

Check that all efabis countries are present in database

check_sex()[source]

check that dict sex table contains data

check_species(country)[source]

Check if all species are defined in UID DictSpecies

eval_columns()[source]

define a set from column data

filter_by_column_values(column, values, ignorecase=False)[source]
classmethod get_dialect(chunk)[source]

Determine dialect of a CSV from a chunk

classmethod is_valid(chunk)[source]

Try to determine if CRBanim has at least the required columns or not

mandatory_columns = ['sex', 'species_latin_name', 'country_of_origin', 'breed_name', 'animal_ID', 'sample_bibliographic_references', 'sample_identifier', 'animal_birth_date', 'sample_storage_temperature', 'sample_type_name', 'body_part_name', 'sampling_date', 'sampling_protocol_url', 'sample_availability', 'EBI_Biosample_identifier']
print_line(num)[source]

print a record with its column names

read_file(filename)[source]

Read crb anim files and set tit to class attribute

crbanim.helpers.check_UID(submission, reader)[source]
crbanim.helpers.fill_uid_animal(record, breed, submission, animals)[source]

Helper function to fill animal data in UID animal table

crbanim.helpers.fill_uid_breed(record, language)[source]

Fill DictBreed from a crbanim record

crbanim.helpers.fill_uid_sample(record, animal, submission)[source]

Helper function to fill animal data in UID sample table

crbanim.helpers.find_storage_type(record)[source]

Determine a sample storage relying on a dictionary

crbanim.helpers.process_record(record, submission, animals, language)[source]
crbanim.helpers.sanitize_url(url)[source]

Quote URLs for accession

crbanim.helpers.upload_crbanim(submission)[source]

crbanim.tasks

crbanim.tasks module contents

Created on Wed Feb 27 16:38:37 2019

@author: Paolo Cozzi <cozzi@ibba.cnr.it>

class crbanim.tasks.ImportCRBAnimTask(*args, **kwargs)[source]

Bases: submissions.tasks.ImportGenericTaskMixin, common.tasks.BaseTask

action = 'crbanim import'
description = 'Import CRBAnim data from CRBAnim data file'
import_data_from_file(submission_obj)[source]

Call the custom import method

name = 'Import CRBAnim'