streetslab / dimelo

python package for analysis of dimelo-seq & nanopore modified base data
MIT License
3 stars 5 forks source link

parse_bam return examples break as-is #9

Closed thekugelmeister closed 2 years ago

thekugelmeister commented 2 years ago

In the documentation for parse_bam, the examples under the Return section

all_data = pd.read_sql("SELECT * from methylationByBase_" + sampleName, sqlite3.connect(outDir + "/" + fileName.split("/")[-1].replace(".bam", "") + ".db"))
aggregate_counts = pd.read_sql("SELECT * from methylationAggregate_" + sampleName, sqlite3.connect(outDir + "/" + fileName.split("/")[-1].replace(".bam", "") + ".db"))

break when run as-is, because they reference undefined variables that contain the values for the arguments. Rectifying this is straightforward, as the missing variables clearly map to the argument names, but it would be nice if these commands ran out of the box.

thekugelmeister commented 2 years ago

Rather than adding lines that define the missing variables, I would suggest replacing them with the intended final values, just to keep things less verbose.

amaslan commented 2 years ago

Ok, good idea. I will add variable definitions to the code block.

amaslan commented 2 years ago

Addressed on cleanup branch. Added variable definitions and put as additional lines just so that the database parsing calls are generalizable and user can clearly see how to adapt it to their own code. Will close when merged.