UofS-Pulse-Binfo / genotypes_loader

A Drush-based loader for VCF files that follows the genotype storage rules outlined by ND genotypes.
GNU General Public License v2.0
1 stars 2 forks source link

error inserting sample data #37

Closed bradfordcondon closed 3 years ago

bradfordcondon commented 5 years ago

I'm running the example command below after creating the matching organism and project.

drush load-genotypes sample_files/sample.vcf sample_files/samples.list --organism="Lens culinaris" --variant-type="SNP" --marker-type="genetic_marker" --project-name="My SNP Discovery Project" --ndgeolocation="here"

and get the following error:

Begin validating options and samples...
  Loading your data according to the "Genotype Call Custom Table" Method.
  Found organism "lens culinaris" in the database.
  Found project "My SNP Discovery Project" in the database.
  Checking for samples [Insert And Select] and for germplasm [Insert And Select] in the database...
PDOException: SQLSTATE[23502]: Not null violation: 7 ERROR:  null value in column "type_id" violates   [error]
not-null constraint
DETAIL:  Failing row contains (2, null, 1, 1048-8R, KP:GERM7951 Individual  Lens Culinaris, null, null,
f). in /Users/bc/tripal/includes/database/database.inc:2227
Stack trace:
#0 /Users/bc/tripal/includes/database/database.inc(2227): PDOStatement->execute(Array)
#1 /Users/bc/tripal/includes/database/pgsql/database.inc(111): DatabaseStatementBase->execute(Array,
Array)
#2 /Users/bc/tripal/includes/database/database.inc(2406): DatabaseConnection_pgsql->query('INSERT INTO
cha...', Array, Array)
#3 /Users/bc/tripal/sites/all/modules/tripal/tripal_chado/api/tripal_chado.query.api.inc(1769):
db_query('INSERT INTO cha...', Array)
#4 /Users/bc/tripal/sites/all/modules/tripal/tripal_chado/api/tripal_chado.query.api.inc(637):
chado_query('INSERT INTO cha...', Array)
#5 /Users/bc/tripal/sites/all/modules/custom/genotypes_loader/api/genotypes_loader.api.inc(99):
chado_insert_record('stock', Array)
#6 /Users/bc/tripal/sites/all/modules/custom/genotypes_loader/genotypes_loader.drush.inc(343):
genotypes_loader_helper_add_record_with_mode('Germplasm', 'stock', 2, Array, Array)
#7 /Users/bc/tripal/sites/all/modules/custom/genotypes_loader/genotypes_loader.drush.inc(155):
genotypes_loader_load_genotypes('/Users/bc/tripa...', '/Users/bc/tripa...', Array)
#8 /Users/bc/.composer/vendor/drush/drush/includes/command.inc(361):
drush_genotypes_loader_load_genotypes('/Users/bc/tripa...', '/Users/bc/tripa...')
#9 /Users/bc/.composer/vendor/drush/drush/includes/command.inc(212): _drush_invoke_hooks(Array, Array)
#10 /Users/bc/.composer/vendor/drush/drush/includes/command.inc(180):
drush_command('sample_files/sa...', 'sample_files/sa...')
#11 /Users/bc/.composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php(64): drush_dispatch(Array)
#12 /Users/bc/.composer/vendor/drush/drush/drush.php(70): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#13 /Users/bc/.composer/vendor/drush/drush/drush.php(11): drush_main()
#14 {main}

I may be making a bad assumption with #33 that the example files are "good to go".

I dump the erroring value:

array(4) {
  'uniquename' =>
  string(38) "KP:GERM7951 Individual  Lens Culinaris"
  'type_id' =>
  NULL
  'organism_id' =>
  int(1)
  'name' =>
  string(7) "1048-8R"
}

so, this stock (germplasm?) needs a type, right? From samples.list... is this an argument i should be supplying with the command? should it be in the example file?

edit- oh i see, its not parsking the samples.list file correctly. the type should be Individual. Why isnt it parsing correctly?

edit- i manually re-parsed the input file, looks better, but i still have no type_id. i think this is because i dont have a term for "Individual" in my db. Should this be part of #35 ?

final edit- i replaced the "Individual" with a known term (mRNA) and still no loading...

laceysanderson commented 3 years ago

Updated samples file to use the Citrus data from the Tripal tutorial, added a demonstration documentation page walking users through inserting the sample data. Tested and it now works on a blank website with only genotypes loader installed and only the steps outlined in the demonstration done.