lib/rbbt/tsv/change_id.rb in rbbt-util-5.19.29 vs lib/rbbt/tsv/change_id.rb in rbbt-util-5.19.30

- old
+ new

@@ -51,12 +51,20 @@ options = Misc.add_defaults options, :persist => false, :identifiers => tsv.identifiers, :compact => true identifiers, persist_input, compact = Misc.process_options options, :identifiers, :persist, :compact identifiers = tsv.identifier_files.first if identifiers.nil? identifiers = Organism.identifiers(tsv.namespace) if identifiers.nil? and tsv.namespace and Organism.identifiers(tsv.namespace).exists? + identifiers.namespace ||= tsv.namespace fields = (identifiers and identifiers.all_fields.include?(field))? [field] : nil - index = identifiers.index :target => format, :fields => fields, :persist => persist_input + #index = identifiers.index :target => format, :fields => fields, :persist => persist_input, :order => true + + grep = Organism.blacklist_genes(tsv.namespace).list if identifiers.namespace and Organism.blacklist_genes(tsv.namespace).exists? + if fields.nil? + index = identifiers.index(:data_tsv_grep => grep, :data_invert_grep => true, :target => format, :persist => true, :order => true, :unnamed => true, :data_persist => true) + else + index = identifiers.index(:data_tsv_grep => grep, :data_invert_grep => true, :target => format, :fields => fields, :order => true, :unnamed => true, :persist => true, :data_persist => true) + end orig_type = tsv.type tsv = tsv.to_double if orig_type != :double pos = tsv.fields.index field