Author Archives: Thomas Cokelaer

How to get pypi statistics about package download

Tweet A while ago, I designed pypiview, a Python package used to fetch the number of downloads for a package hosted on pypi website. It used to work decently but according to pypi itself the values stored are not reliable … Continue reading

Posted in Python | Tagged , , , | Leave a comment

How to prevent wget from creating duplicates

Tweet wget is used to download file from internet. For instance:

So far so good but two things may happen. First, you may interrupt the download. Second, you may load the file again. Sometimes, files are huge and you … Continue reading

Posted in Linux | Tagged | Leave a comment

Meaning of Real, User and Sys time statistics

Tweet Under Linux, the time command is quite convenient to get the elapsed time taken by a command call. It is very simple to use: just type your command preceded by the time command itself. For instance:

The output … Continue reading

Posted in Linux | 2 Comments

git : How to remove a big file wrongly committed

Tweet I added a large file to a git repository (102Mb), commited and push and got an error due to size limit limitations on github

Here, you see the path of the file (coverage/sensitivity/simualted.bed). So, the solution is actually … Continue reading

Posted in Computer Science | Tagged , | Leave a comment

git and github : skip password typing with https

Tweet If you clone a github repository using the https:// method (instead of ssh), you will have to type your username and passwor all the time. In order to avoid having to type you password all the time, you can … Continue reading

Posted in Computer Science | Tagged | Leave a comment

failed to convert from cram to bam (parse error CIGAR character)

Tweet In order to convert a bioinformatic file from CRAM to BAM format, I naively used the samtools command available on a cluster but got this error:

After a few commands trying to fix the issue, I realised that … Continue reading

Posted in bioinformatics | Tagged | Leave a comment

How to mount and create a partition on a hard drive dock (fedora)

Tweet I got a new hard drive (2.7Tb) but wanted to use it with a docking station. Here are the steps required to use it under my Fedora box. First, I naively went into the Nautilus File Browser hoping to … Continue reading

Posted in Linux | Tagged , | Leave a comment

AWK: convert into lower or upper cases

Tweet In order to convert a bash variable to lower case with awk, just use this command:

If you want to convert the content of a file (called data.csv) to lower case:

Of course to convert into upper … Continue reading

Posted in Linux | Tagged , | Leave a comment

How to sort a dictionary by values in Python

Tweet By definition, dictionary are not sorted (to speed up access). Let us consider the following dictionary, which stores the age of several persons:

If you want to sort this dictionary by values (i.e., the age), you must be … Continue reading

Posted in Python, Uncategorized | Tagged , | Leave a comment

Python: how to copy a list

Tweet To explain how to create a copy of a list, let us first create a list. We will use a simple list of 4 items:

Why do we want to create a copy anyway ? Well, because in … Continue reading

Posted in Python | Tagged , | Leave a comment