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

PyStarcode #21

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open

PyStarcode #21

wants to merge 31 commits into from

Conversation

rcortini
Copy link

This PR includes the first draft of a python module with Starcode functionality, named pystarcode.

The module has only one function, starcode. The function takes as input a Python list of sequences (as strings), the required maximum distance argument, and returns two dictionaries:

  • counts: associates the sequence of a canonical to its counts
  • d: associates the sequences of the list to its canonical.

The idea is that the user will parse a file and obtain a list of sequences on their own. Then the output dictionaries can be used for calculations on those input sequences.

Techincal details

The module uses the Python C API (for python 2.7). The Starcode main was modified so that all the calculations on the sequences are performed by the starcode function. The argument parsing, the compatibility between the input flags, and the output of the program were transferred to separate functions.

The starcode function now accepts a gstack_t stack as input, and returns a gstack_t function as output.

Limitations

At the moment, output of the pystarcode.starcode function is limited to the one when using the mp clustering method.

TODO

Immediate

  • Write proper documentation of the starcode method
  • Check the origin of memory leaks in the main
  • Implement the output for other clustering algorithms

More features to be added in the future:

  • Add a parser to Starcode files
  • Return output in a more complex data structure?

Ruggero Cortini and others added 30 commits May 24, 2018 10:40
@ezorita ezorita requested review from ezorita and gui11aume June 29, 2018 10:19
@raivivek
Copy link

raivivek commented May 7, 2020

@rcortini I think this was an excellent idea. It's been a while so I'm not sure how much interest is remaining to complete this. But I think it'll be nice to have.

@ezorita
Copy link
Collaborator

ezorita commented May 8, 2020

I wonder how much work it would be to port this to Python 3. @rcortini any insight on this? Why didn't we merge this in the first place? Does anyone remember?

@rcortini
Copy link
Author

rcortini commented May 8, 2020

Hi All, there's indeed quite a lot of work to do, because to get this to run I had to extensively modify the logics of the main routines of starcode. After that, there were major changes upstream, so this current PR doesn't have any hope of working. I'd have to look at it again from scratch.

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

Successfully merging this pull request may close these issues.

3 participants