lib/seek/parser_mapper.rb
# mapping for jena excel sheets
# example file: jenage-excel_template-without-protection correct.xlsm
mapping for jena excel sheets
example file: jenage-excel_template-without-protection correct.xlsm
mapping for jena excel sheets example file : jenage - excel_template - without - protection correct . xlsm
def jena_mapping
      {
          :name => "jena",
          :data_row_offset => 2,
          :samples_mapping => {
              :samples_sheet_name => "SDRF",
              :add_specimens => true,
              :add_treatments => true,
              :add_samples => true,
              :probing_column => :"specimens.title",
              :"organisms.title" => mapping_entry("Organism"),
              :"strains.title" => mapping_entry("Strain or Line"),
              :"specimens.sex" => mapping_entry("Sex"),
              :"specimens.title" => mapping_entry("# Specimen"),
              :"specimens.lab_internal_number" => mapping_entry("# Specimen"),
              :"specimens.age" => mapping_entry("Age"),
              :"specimens.age_unit" => mapping_entry("Age Time Unit"),
              :"specimens.comments" => mapping_entry("FIXED", proc {""}),
              :"specimens.genotype.title" => mapping_entry("FIXED", proc {"none"}),
              :"specimens.genotype.modification" => mapping_entry("FIXED", proc{""}),
              :"treatment.treatment_protocol" => mapping_entry("Treatment Protocol"),
              :"treatment.type" => mapping_entry("FIXED", proc {"concentration"}),
              :"treatment.comments" => mapping_entry("FIXED", proc {""}),
              :"treatment.substance" => mapping_entry("Substance"),
              :"treatment.concentration" => mapping_entry("Concentration"),
              :"treatment.unit" => mapping_entry("Unit"),
              :"treatment.incubation_time" => mapping_entry("FIXED", proc {nil}),
              :"treatment.incubation_time_unit" => mapping_entry("FIXED", proc {""}),
              :"samples.comments" => mapping_entry("Additional Information"),
              :"samples.title" => mapping_entry("Sample Name"),
              :"samples.sample_type" => mapping_entry("Material Type"),
              :"samples.donation_date" => mapping_entry("Storage Date", proc  {|data| data != "" ? data : Time.now}), 
              :"samples.organism_part"  => mapping_entry("FIXED", proc {""}),
              :"tissue_and_cell_types.title" => mapping_entry("Organism Part"),
              :"sop.title" => mapping_entry("Storage Protocol"),
              :"institution.title" => mapping_entry("Storage Location")
          },
          :assay_mapping => {
              :assay_sheet_name => "IDF",
              :parsing_direction => "horizontal",
              :probing_column => "",
              :"investigation.title" => mapping_entry("Investigation Title"),
              :"assay_type.title" => mapping_entry("Experiment Class"),
              :"study.title" => mapping_entry("Experiment Description"),
              :"creator.email" => mapping_entry("Person Email"),
              :"creator.last_name" => mapping_entry("Person Last Name"),
              :"creator.first_name" => mapping_entry("Person First Name")
          }
      }
    end
def jena_mapping { :name => "jena" , :data_row_offset => 2 , :samples_mapping => { :samples_sheet_name => "SDRF" , :add_specimens => true , :add_treatments => true , :add_samples => true , :probing_column => :" specimens.title " , :" organisms.title " => mapping_entry ( "Organism" ) , :" strains.title " => mapping_entry ( "Strain or Line" ) , :" specimens.sex " => mapping_entry ( "Sex" ) , :" specimens.title " => mapping_entry ( "# Specimen" ) , :" specimens.lab_internal_number " => mapping_entry ( "# Specimen" ) , :" specimens.age " => mapping_entry ( "Age" ) , :" specimens.age_unit " => mapping_entry ( "Age Time Unit" ) , :" specimens.comments " => mapping_entry ( "FIXED" , proc { "" } ) , :" specimens.genotype.title " => mapping_entry ( "FIXED" , proc { "none" } ) , :" specimens.genotype.modification " => mapping_entry ( "FIXED" , proc { "" } ) , :" treatment.treatment_protocol " => mapping_entry ( "Treatment Protocol" ) , :" treatment.type " => mapping_entry ( "FIXED" , proc { "concentration" } ) , :" treatment.comments " => mapping_entry ( "FIXED" , proc { "" } ) , :" treatment.substance " => mapping_entry ( "Substance" ) , :" treatment.concentration " => mapping_entry ( "Concentration" ) , :" treatment.unit " => mapping_entry ( "Unit" ) , :" treatment.incubation_time " => mapping_entry ( "FIXED" , proc { nil } ) , :" treatment.incubation_time_unit " => mapping_entry ( "FIXED" , proc { "" } ) , :" samples.comments " => mapping_entry ( "Additional Information" ) , :" samples.title " => mapping_entry ( "Sample Name" ) , :" samples.sample_type " => mapping_entry ( "Material Type" ) , :" samples.donation_date " => mapping_entry ( "Storage Date" , proc { | data | data != "" ? data : Time . now } ) , :" samples.organism_part " => mapping_entry ( "FIXED" , proc { "" } ) , :" tissue_and_cell_types.title " => mapping_entry ( "Organism Part" ) , :" sop.title " => mapping_entry ( "Storage Protocol" ) , :" institution.title " => mapping_entry ( "Storage Location" ) } , :assay_mapping => { :assay_sheet_name => "IDF" , :parsing_direction => "horizontal" , :probing_column => "" , :" investigation.title " => mapping_entry ( "Investigation Title" ) , :" assay_type.title " => mapping_entry ( "Experiment Class" ) , :" study.title " => mapping_entry ( "Experiment Description" ) , :" creator.email " => mapping_entry ( "Person Email" ) , :" creator.last_name " => mapping_entry ( "Person Last Name" ) , :" creator.first_name " => mapping_entry ( "Person First Name" ) } } end
mapping for jena excel sheets
example file: jenage-excel_template-without-protection correct.xlsm
mapping for jena excel sheets example file : jenage - excel_template - without - protection correct . xlsm
# the default value is certainly wrong -- but we need some donation_date