Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getSequenceNames() returns an array of string integers instead of the sequence names #49

Closed
shihabdider opened this issue Mar 29, 2021 · 2 comments · Fixed by #51
Closed

Comments

@shihabdider
Copy link

I'm trying to retrieve the list of sequence names in the fasta file but it seems that the getSequenceNames() method just returns a list of ints (as strings) of length the number of sequences in the fasta. If I run getSequenceSizes(), the names of the sequences in the returned object keys are different (and correct), but if I use getSequenceSize(seqName) with one of the seqNames returned from getSequenceNames() the return is undefined.

seq.getSequenceNames()
[
  '0',  '1',  '2',  '3',  '4',  '5',  '6',  '7',  '8',  '9',
  '10', '11', '12', '13', '14', '15', '16', '17', '18', '19',
  '20', '21', '22', '23', '24', '25', '26', '27', '28', '29',
  '30', '31', '32', '33', '34', '35', '36', '37', '38', '39',
  '40', '41', '42', '43', '44', '45', '46', '47', '48', '49',
  '50', '51', '52', '53', '54', '55', '56', '57', '58', '59',
  '60', '61', '62', '63', '64', '65', '66', '67', '68', '69',
  '70', '71', '72', '73', '74', '75', '76', '77', '78', '79',
  '80', '81', '82', '83', '84', '85', '86', '87', '88', '89',
  '90', '91', '92', '93', '94', '95', '96', '97', '98', '99',
  ... 355 more items
]

seq.getSequenceSizes()
{
  'NC_000001.11': 248956422,
  'NT_187361.1': 175055,
  'NT_187362.1': 32032,
  'NT_187363.1': 127682,
  'NT_187364.1': 66860,
  'NT_187365.1': 40176,
  'NT_187366.1': 42210,
  'NT_187367.1': 176043,
  'NT_187368.1': 40745,
  'NT_187369.1': 41717,
  'NC_000002.12': 242193529,
  'NT_187370.1': 161471,
  'NT_187371.1': 153799,
  'NC_000003.12': 198295559,
  ...
}

seq.getSequenceSize('0')
undefined
@garrettjstevens
Copy link
Contributor

It appears we have two methods that are supposed to do the same thing (or at least they have the exact same JSDoc description), but one of them doesn't work correctly. getSequenceNames() appears to not work, as you described, however getSequenceList() does work and should provide the information you're looking for.

@cmdcolin
Copy link
Collaborator

Thanks for catching...I propose #50 to fix (just updating the docs to refer to getSequenceList() instead of getSequenceNames())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants