goatools.parsers.ncbi_gene_file_reader module

Reads an NCBI Gene tsv file.

class goatools.parsers.ncbi_gene_file_reader.NCBIgeneFileReader(fin, sep='\t', **kwargs_dict)[source]

Bases: object

Reads an NCBI Gene tsv file.

Generate the NCBI gene file by following these steps:
  1. Open a browser at: https://www.ncbi.nlm.nih.gov/gene

  2. Type search text. Example: genetype protein coding[Properties] AND “3702”[Taxonomy ID] AND alive[property]

  3. Press the “Search” button.

  4. From the pull down menu: “Send to” -> File

get_h2i(hdrs_usr)[source]

Read csv/tsv file and return specified data in a list of lists.

do_hdr(line, hdrs_usr)[source]

Initialize self.h2i.

run(fnc_name, hdrs_usr)[source]

Read csv/tsv file and return specified data in a list of lists.

get_nts()[source]

Read csv/tsv file and return specified data in a list of lists.

hdr_xform(hdrs)[source]

Transform NCBI Gene header fields into valid namedtuple fields.

static replace_nulls(hdrs)[source]

Replace ‘’ in hdrs.

convert_ints_floats(flds)[source]

Convert strings to ints and floats, if so specified.