Skip to main content

collect-columns

This tool retrieves a column from each in a set of tables and compiles into a single table. Optionally, additional attributes from the associated GTF/GFF file may be added to the output tables.

Installation

Install from PyPI: pip install collect-columns

Install from github:

  • Clone the repository: git clone https://github.com/biowdl/collect-columns.git
  • Enter the repository: cd collect-columns
  • Install using pip: pip install .

Usage

collect-columns output_path input_files...

It assumes that all input count tables are in the same format. By default the format is assumed to be headerless and tab separated, with the first column being the feature identifiers and the second the values of interest. The output table will use the same separator as the input tables and contain a header. The feature column will contain the feature identifiers, the value columns will be named after the input files or according to the names given through the -n option, which takes a list of names as argument.

Please note that if multiple rows with the same feature identifier exist in an input table, then these values will overwrite each other in the output table by default. See also the -S flag.

In order to use a different input format the following options can be given:

option arguments definition
-f a number The index of the column containing the feature identifiers.
-c a number The index of the column containing the values/counts.
-s a character The separator.
-H Indicates that the table has a header.
-S Indicates that values should be added up if multiple rows exist with the same feature id. The values will become floats if this flag is set. By default only the last value will be taken and a warning will be give.

To add additional attributes from a GTF/GFF, the following options can be given:

option arguments definition
-a a list of words The attributes to be added to the output table.
-g a path The gtf file from which the attributes will be retrieved.
-F a word The attribute used to map rows in the input tables to gtf record. Defaults to gene_id.

Examples

HTSeq-count

Using the output from HTSeq-count as input the following command:

collect-columns all.tsv s1.tsv s2.tsv

will result in a table like:

feature s1.tsv s2.tsv
MSTRG.1 10 11
MSTRG.2 60 12
... ... ...

Stringtie

Using stringtie abundance output as input, the following command:

collect-columns all.FPKM s1.abundance s2.abundance \
    -c 7 \
    -H \
    -a ref_gene_id gene_name \
    -g merged.gtf \
    -n sample1 sample2 \
    -S # Stringtie may at times return multiple rows for one gene, these values can simply be summed up.

will result in a table like:

feature ref_gene_id gene_name sample1 sample2
MSTRG.1 g_1 gene_1 185151.953125 151.964231
MSTRG.2 g_2 gene_2 100160.070312 1160.030213
... ... ... ... ...

Metadata

Release files for collect-columns 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for collect-columns 1.0.0
File Size Uploaded Provenance Actions
collect-columns-1.0.0.tar.gz 5.9 kB Without provenance Details for collect-columns-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for collect-columns 1.0.0
File Interpreter ABI Platform Actions
collect_columns-1.0.0-py3-none-any.whl Python 3 none any Details for collect_columns-1.0.0-py3-none-any.whl

Total release size: 13.7 kB

Release files / collect-columns-1.0.0.tar.gz

Download URL collect-columns-1.0.0.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
13aefe84172da40d5b3ba4fc0066b9b11f05c6530bf951fee688ed050b8ba618
BLAKE2b-256 checksum
How to use checksums
994fe68a69440ff76793b8f5332a3337a70408f08647e5c40d13e963f204abe4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

Release files / collect_columns-1.0.0-py3-none-any.whl

Download URL collect_columns-1.0.0-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0aaac536f0886c5819f4c4adc751ae90b3eeca7ab7e04146ab8b060251796adc
BLAKE2b-256 checksum
How to use checksums
52355eb5882ca64cd9d4d3c0144e729b095c535d02fe83e35be41dcc30522e3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3

Security for collect-columns 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page