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

Counting lines #17

Open
evaegelyng opened this issue Aug 31, 2022 · 0 comments
Open

Counting lines #17

evaegelyng opened this issue Aug 31, 2022 · 0 comments

Comments

@evaegelyng
Copy link

Hi Adria,

In the script MOTUs_from_SWARM.sh, there is the following code to count the number of lines in the MOTUs file:

linies=$(wc -l ${motu_list} | cut -f1 -d ' ')

In my pipeline, I changed this line to python, and got a result a slightly different result:

#lines=$(wc -l ${MOTUS2RUN} | cut -f1 -d ' ') # Result: 216268

with open(MOTUS2RUN, 'r') as fp:
read = fp.readlines()
lines = len(read) # Result: 216269, covering read[0] to reads[216268].

It seems like the result from bash was incorrect by one line? Maybe you could compare the two methods on one of your files and see if you also get different results?

Best,

Eva

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

No branches or pull requests

1 participant