[med-svn] [Git][med-team/tnseq-transit][master] 2 commits: New upstream version 3.3.12
Alexandre Detiste (@detiste-guest)
gitlab at salsa.debian.org
Mon Feb 3 13:58:17 GMT 2025
Alexandre Detiste pushed to branch master at Debian Med / tnseq-transit
Commits:
3111de6b by Alexandre Detiste at 2025-02-03T14:47:56+01:00
New upstream version 3.3.12
- - - - -
0f7c76d4 by Alexandre Detiste at 2025-02-03T14:51:44+01:00
Update upstream source from tag 'upstream/3.3.12'
Update to upstream version '3.3.12'
with Debian dir fd858633d5293606d79bfac92a76a2ff89e89cc5
- - - - -
8 changed files:
- CHANGELOG.md
- setup.py
- src/pytransit/__init__.py
- src/pytransit/analysis/pathway_enrichment.py
- src/pytransit/doc/source/method_pathway_enrichment.rst
- src/pytransit/doc/source/transit_install.rst
- src/pytransit/doc/source/transit_running.rst
- + src/pytransit/generic_tools/__init__.py
Changes:
=====================================
CHANGELOG.md
=====================================
@@ -2,6 +2,21 @@
All notable changes to this project will be documented in this file.
+## Version 3.3.12 (2024-12-13)
+#### Transit:
+
+Minor changes:
+ - Tiny adjustment of packages in setup.py
+
+
+## Version 3.3.11 (2024-12-13)
+#### Transit:
+
+Minor changes:
+ - Added NES (normalized enrichment score) for GSEA method in pathway_enrichment analysis
+ - changed package name on PyPi from 'tnseq-transit' to 'transit1'; updated Installation documentation
+
+
## Version 3.3.10 (2024-12-02)
#### Transit:
=====================================
setup.py
=====================================
@@ -108,7 +108,8 @@ class UploadCommand(Command):
sys.exit()
self.status('Building Source and Wheel (universal) distribution...')
- os.system('{0} setup.py sdist bdist_wheel'.format(sys.executable))
+ #os.system('{0} setup.py sdist bdist_wheel'.format(sys.executable))
+ os.system('{0} -m build'.format(sys.executable))
if self.yes_or_no("Add tag and push to public github? tag:v{0}".format(version)):
self.status('Adding and pushing git tags to origin and public...')
@@ -139,7 +140,7 @@ package_data = {
}
setup(
- name='tnseq-transit',
+ name='transit1',
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
@@ -179,8 +180,8 @@ setup(
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
- packages = find_packages('src', exclude=['contrib', 'tests']),
- #packages = ['pytransit'],
+ #packages = find_packages('src', exclude=['contrib', 'tests']), # any subdir in src/ with __init__.py
+ packages = ['pytransit.generic_tools', 'pytpp', 'pytransit'],
package_dir = {'pytransit': 'src/pytransit', 'pytpp': 'src/pytpp'},
include_package_data=True,
#py_modules = ['tpp'],
=====================================
src/pytransit/__init__.py
=====================================
@@ -2,6 +2,6 @@
__all__ = ["transit_tools", "tnseq_tools", "norm_tools", "stat_tools"]
-__version__ = "v3.3.10"
+__version__ = "v3.3.12"
prefix = "[TRANSIT]"
=====================================
src/pytransit/analysis/pathway_enrichment.py
=====================================
@@ -219,7 +219,14 @@ Optional parameters:
index = {}
for i in range(len(lst)): index[lst[i]] = i
return index
-
+
+ # for a gene set of size n, what is the expected mean of the null distribution?
+
+ def calc_NES(self,es,null_dist):
+ if es>0: return es/numpy.mean(list(filter(lambda x: x>0,null_dist)))
+ else: return -es/numpy.mean(list(filter(lambda x: x<=0,null_dist)))
+
+ # A is list of hits (genes)
# based on GSEA paper (Subramanian et al, 2005, PNAS)
# ranks and scores are hashes from genes into ranks and SLPV
# when p=0, ES(S) reduces to the standard K-S statistic; p=1 is used in PNAS paper
@@ -235,13 +242,15 @@ Optional parameters:
NR = sum(powers)
if NR==0: return 0 # special case
Nmiss = n-len(A) # totalGenes-hits
- powersum,best = 0,-1
+ powersum,best = 0,0
for i in range(len(powers)):
powersum += powers[i]
Phit = powersum/float(NR)
Pmiss = (Aranks[i]-i)/float(Nmiss)
- es = abs(Phit-Pmiss) # looking for max deviation
- if es>best: best = es
+ #es = abs(Phit-Pmiss) # looking for max deviation
+ #if es>best: best = es
+ es = Phit-Pmiss # looking for max deviation
+ if abs(es)>abs(best): best = es
return best
def mean_rank(self,A,orfs2ranks):
@@ -269,17 +278,20 @@ Optional parameters:
self.write("# ranking genes by %s" % self.ranking)
self.write("# total genes: %s, mean rank: %s" % (len(data),n2))
- # rank by SLPV=sign(LFC)*log10(pval)
- # note: genes with lowest p-val AND negative LFC have highest scores (like positive correlation)
- # there could be lots of ties with pval=0 or 1, but so be it (there are probably fewer such ties than with Qvals) (randomize order below)
pairs = [] # pair are: rv and score (SLPV)
for w in data:
orf = w[0]
if self.ranking=="SLPV":
+ # the old way: rank by SLPV=sign(LFC)*log10(pval)
+ # note: genes with lowest p-val AND negative LFC have highest scores (like positive correlation)
+ # there could be lots of ties with pval=0 or 1, but so be it (there are probably fewer such ties than with Qvals) (randomize order below)
+ # 12/9/24 (TRI):
+ # I am changing this to SLPV=sign(LFC)*(-log10(pval)), so now genes with pos LFC are ranked at top
+
#Pval_col = headers.index("p-value")
Pval = float(w[self.Pval_col])
LFC = float(w[self.LFC_col])
- SLPV = (-1 if LFC<0 else 1)*math.log(Pval+0.000001,10)
+ SLPV = (-1 if LFC<0 else 1)*(-1*math.log(Pval+0.000001,10)) # changing to sgn*(-log10(Pval))
pairs.append((orf,SLPV))
elif self.ranking=="LFC":
#LFC_col = headers.index("log2FC")
@@ -291,7 +303,7 @@ Optional parameters:
indexes = numpy.random.permutation(indexes).tolist()
pairs = [pairs[i] for i in indexes]
- pairs.sort(key=lambda x: x[1],reverse=True) # emulate ranking genes with *higher* correlation at top
+ pairs.sort(key=lambda x: x[1],reverse=True) # emulate ranking genes with *higher* correlation (expression, pos LFC) at top
orfs2rank,orfs2score = {},{}
for i,(orf,score) in enumerate(pairs):
orfs2score[orf] = score
@@ -305,22 +317,26 @@ Optional parameters:
num_genes_in_pathway = len(orfs)
if num_genes_in_pathway<2: continue # skip pathways with less than 2 genes
mr = self.mean_rank(orfs,orfs2rank)
- es = self.enrichment_score(orfs,orfs2rank,orfs2score,p=self.p) # always positive, even if negative deviation, since I take abs
- higher = 0
+ es = self.enrichment_score(orfs,orfs2rank,orfs2score,p=self.p) # could be pos or neg
+ larger = 0
+ null_dist = []
for n in range(Nperm):
perm = random.sample(allgenes,num_genes_in_pathway) # compare to enrichment score for random sets of genes of same size
e2 = self.enrichment_score(perm,orfs2rank,orfs2score,p=self.p)
- if e2>es: higher += 1
- if n>100 and higher>10: break # adaptive: can stop after seeing 10 events (permutations with higher ES)
- pval = higher/float(n)
+ null_dist.append(e2)
+ if abs(e2)>abs(es): larger += 1
+ if n>100 and larger>10: break # adaptive: can stop after seeing 10 events (permutations with larger ES)
+ NES = self.calc_NES(es,null_dist)
+ pval = larger/float(n)
+ #print("pathway=%s (%s), ES=%s, NES=%s, pval=%s" % (term,len(orfs),es,NES,pval))
vals = ['#',term,num_genes_in_pathway,mr,es,pval,ontology.get(term,"?")]
#sys.stderr.write(' '.join([str(x) for x in vals])+'\n')
pctg=(100.0*i)/Total
text = "Running Pathway Enrichment Method... %5.1f%%" % (pctg)
self.progress_update(text, i)
- results.append((term,mr,es,pval))
+ results.append((term,mr,NES,pval))
- results.sort(key=lambda x: x[1]) # sort on mean rank
+ results.sort(key=lambda x: x[2],reverse=True) # sort on NES
pvals = [x[-1] for x in results]
rej,qvals = multitest.fdrcorrection(pvals)
results = [tuple(list(res)+[q]) for res,q in zip(results,qvals)]
@@ -340,7 +356,7 @@ Optional parameters:
if qval<0.05 and mr>n2: self.write("# %s %s (mean_rank=%s)" % (term,ontology.get(term,"?"),mr))
self.write("# pathways sorted by mean_rank")
- self.output.write('\t'.join("#pathway description num_genes mean_rank GSEA_score pval qval genes".split())+'\n')
+ self.output.write('\t'.join("#pathway description num_genes mean_rank GSEA_NES(normalized_enrichment_score) pval qval genes".split())+'\n')
for term,mr,es,pval,qval in results:
rvs = terms2orfs[term]
rvinfo = [(x,genenames.get(x,"?"),orfs2rank.get(x,n2)) for x in rvs]
=====================================
src/pytransit/doc/source/method_pathway_enrichment.rst
=====================================
@@ -27,8 +27,9 @@ original annotation of the H37Rv genome (`Cole et al, 1998 <https://www.ncbi.nlm
with subsequent updates),
COG categories (`Clusters of Orthologous Genes <https://www.ncbi.nlm.nih.gov/pubmed/25428365>`_),
also GO terms (Gene Ontology), and `KEGG <https://www.genome.jp/kegg/>`_.
-Pre-formatted annotation files for *M. tuberculosis* H37Rv and several other mycobacteria can be found in
-`pathways.html <https://orca1.tamu.edu/essentiality/transit/pathways.html>`_.
+
+.. NOTE:
+ Pre-formatted annotation files for *M. tuberculosis* H37Rv and several other mycobacteria can be found in `pathways.html <https://orca1.tamu.edu/essentiality/transit/pathways.html>`_.
For other organisms, it might be possible to download COG categories from
@@ -223,5 +224,49 @@ Examples
The $DATA environment variable in these examples refers to the Transit data directory, e.g. src/pytransit/data/.
+Output File Formats
+-------------------
+
+*Pathway_enrichment* methods generates output files in the form of tab-separated spreadsheets, which you can load into and view in Excel.
+The files include various information in the header (lines prefixed by '#'), including the command that
+was executed (with flags), overall number of genes, and a summary of significant pathways.
+
+For **GSEA** analysis, the columns in the output file are:
+
+ * **pathway id**
+ * **description** - pathway name
+ * **num_genes** - number of genes in the pathway
+ * **mean_rank** - average rank of pathway genes (with 1 being most positive LFC or most significant, depending on whether sorting on LFC or SLPV) among all genes in genome
+ * **GSEA_NES** - normalized_enrichment_score; enrichment scores are calculated and then normalized as described in `(Subramaniam et al., 2005) <http://www.pnas.org/content/102/43/15545.short>`_
+ * **pval** - P-value calculated using permutations, as described in `(Subramaniam et al., 2005) <http://www.pnas.org/content/102/43/15545.short>`_
+ * **qval** - P-value adjusted using Benjamini-Hochberg correction for multiple tests
+ * **genes** - list of genes in the pathway sorted by rank, with their ranks in parentheses
+
+The output file is sorted by NES, from pathways with most positive enrichment to most negative.
+
+The criterion for statistical significance is genes with **'qval<0.05'**.
+
+Note that while the genes with the most extreme NES are usually the most significant,
+the correlation is not perfect, because significance also depends on the gene set size.
+
+
+For **FET** analysis, the columns in the output file are:
+
+ * **pathway id**
+ * **total_genes(M)** - number of genes in genome
+ * **genes_in_path(n)** - number of genes in the pathway
+ * **significant_genes(N)** - total significant genes (usually determined from input file as 'qval<0.05'; can be adjusted using flags)
+ * **signif_genes_in_path(k)** - subset of significant genes that are in the pathway (intersection)
+ * **expected** - expected number of signfican genes in the pathway based on genome-wide proportions
+ * **k+PC** - significant genes in pathway, adjusted by adding pseudo-count
+ * **n_adj_by_PC** - total genes in pathway, adjusted by adding pseudo-count
+ * **enrichment** - log2 of ratio of observed to expected number of significant genes in pathway (calculated with pseudocounts)
+ * **pval** - P-value (significance of enrichment) based on hypergeometric distribution (based on k, n, M, and N)
+ * **qval** - P-value adjusted using Benjamini-Hochberg correction for multiple tests
+ * **description** - pathway name
+ * **genes** - list of genes in the pathway sorted by rank, with their ranks in parentheses
+
+|
+
.. rst-class:: transit_sectionend
------
=====================================
src/pytransit/doc/source/transit_install.rst
=====================================
@@ -5,11 +5,11 @@
Installation
============
TRANSIT can be downloaded from the public GitHub server,
-`http://github.com/mad-lab/transit <http://github.com/mad-lab/transit>`_. It is released under a GPL
+`http://github.com/ioerger/transit <http://github.com/ioerger/transit>`_. It is released under a GPL
License. An archive with the lastest version fo the source code can be downloaded at the following link:
-`Source code.zip <https://github.com/mad-lab/transit/archive/master.zip>`_
+`Source code.zip <https://github.com/ioerger/transit/archive/master.zip>`_
@@ -18,10 +18,10 @@ If you know how to utilize git, you can clone the git respository as follows:
::
- git clone https://github.com/mad-lab/transit/
+ git clone https://github.com/ioerger/transit/
-TRANSIT is python-based You must have python installed (installed by
+TRANSIT is python-based. You must have python installed (installed by
default on most systems). In addition, TRANSIT relies on some python
packages/libraries/modules that you might need to install (see `Requirements`_).
@@ -30,6 +30,32 @@ If you encounter problems, please :ref:`contact us <developers>` or head to the
|
+
+Installing Transit (and its Dependencies) using pip
+---------------------------------------------------
+
+You can use pip to install the TRANSIT package.
+
+::
+
+ sudo pip install transit1
+
+This will automatically download and install TRANSIT as a package, and all remaining required python packages. Once TRANSIT is installed as a package, it can be executed at the command-line as 'transit', which should pop-up the GUI.
+
+
+.. NOTE::
+ In Dec 2024, we switched the package name on PyPi from 'tnseq-transit' to 'transit1'.
+
+
+.. NOTE::
+ If you will be using the pre-processor, TPP, you will also need to install :ref:`install BWA <bwa-unix>`.
+
+
+.. NOTE::
+ The Transit package *does not* install R, which would have to be done manually. R is not required for all of Transit, just certain methods (like ZINB).
+
+
+
Requirements
------------
@@ -52,7 +78,7 @@ To use TRANSIT with python2, use a TRANSIT release prior to 3.0 (e.g. v2.5.2)
Python 3:
------------
+~~~~~~~~~
The following libraries/modules are required to run TRANSIT:
@@ -76,7 +102,7 @@ Pip and Python are usually preinstalled in most modern operating systems.
|
Python 2.7:
------------
+~~~~~~~~~~~
The following libraries/modules are required to run TRANSIT:
@@ -99,113 +125,108 @@ Pip and Python are usually preinstalled in most modern operating systems.
|
-.. _install-zinb:
+Install BWA to use with TPP pre-processor (optional)
+~~~~~~~~~~~~~~~~~~~~~~~~~
-Additional Requirements: R (statistical analysis package)
-~~~~~~~~~~~~~~~~~~~~~~~~~~
+If you will be using the pre-processor, TPP, you will also need to install `BWA <http://bio-bwa.sourceforge.net/>`_.
-R is called by Transit for certain commands, such as :ref:`ZINB <zinb>`, corrplot, and heatmap.
-As of now, installing R is optional, and requires these additional steps...
-Additional Installation Requirements for R:
- - install `R <https://www.r-project.org/>`_ (tested on v3.5.2)
- - R packages: **MASS, pscl, corrplot, gplots** (run "install.packages(MASS)" etc. in R console)
- - Python packages (for python3): rpy2 (v>=3.0) (run "pip3 install rpy2" on command line)
- - Python packages (for python2.7): rpy2 (v<2.9.0) (run "pip install 'rpy2<2.9.0' " on command line)
+.. _bwa-unix:
+
+Linux & OSX Instructions
+~~~~~~~~~~~~~~~~~~~~~~~~
+Download the source files:
-Use as a Python Package
------------------------------------------------------
+ + `http://sourceforge.net/projects/bio-bwa/files/ <http://sourceforge.net/projects/bio-bwa/files/>`_
-TRANSIT can be (optionally) installed as a python package. This can simplify the installation process as it will automatically install most of the requirements. In addition, it will allow users to use some of transit functions in their own scripts if they desire. Below is a brief example of importing transit functions into python. In this example, pair of .wig files are parsed into their read-counts (data) and genomic positions (position), and then normalization factors are calculated. See the documentation of the package for further examples:
+Extract the files:
::
- >>> import pytransit.norm_tools as norm_tools
- >>> import pytransit.tnseq_tools as tnseq_tools
- >>> (data, position) = tnseq_tools.get_data(["transit/data/glycerol_H37Rv_rep1.wig", "transit/data/glycerol_H37Rv_rep2.wig"])
- >>> print(data)
- array([[ 0., 0., 0., ..., 0., 0., 0.],
- [ 0., 0., 0., ..., 0., 0., 0.]])
- >>> factors = norm_tools.TTR_factors(data)
- >>> print(factors)
- array([[ 1. ],
- [ 0.62862886]])
+ tar -xvjf bwa-0.7.12.tar.bz2
-You can use pip to install the TRANSIT package.
+Go to the directory with the extracted source-code, and run make to create the executable files:
::
- sudo pip install tnseq-transit
-
-This will automatically download and install TRANSIT as a package, and all remaining required python packages. Once TRANSIT is installed as a package, it can be executed as
-
-
-.. NOTE::
- If you will be using the pre-processor, TPP, you will also need to install :ref:`install BWA <bwa-unix>`.
-.. NOTE::
- The Transit package *does not* install wxPython. For graphical interface usage, this has to be done by the user. See :ref:`install wxPython <install-wxpython>`
-
-|
+ cd bwa-0.7.12
+ make
-Optional: Install BWA to use with TPP pre-processor
----------------------------------------------------
-If you will be using the pre-processor, TPP, you will also need to install `BWA <http://bio-bwa.sourceforge.net/>`_.
+.. _bwa-win:
+.. _install-wxpython:
+Installing wxPython
+~~~~~~~~~~~~~~~~
+wxPython 4+ can be installed using pip
-.. _bwa-unix:
+::
-Linux & OSX Instructions
-~~~~~~~~~~~~~~~~~~~~~~~~
+ pip install wxPython
-Download the source files:
+If the above command fails and you already have wxPython < 4.0 installed, you may have to manually remove it.
+See https://stackoverflow.com/questions/50688630/cannot-uninstall-wxpython-3-0-2-0-macos for details.
+.. NOTE::
- + `http://sourceforge.net/projects/bio-bwa/files/ <http://sourceforge.net/projects/bio-bwa/files/>`_
+ Installing *wxPython* can be a bit finicky. It might require installing the
+ development version of GTK first. There are at least two versions currently,
+ *gtk2* and *gtk3*.
+ Transit should work with both, although there can be small differences in the
+ visual look of the GUI. To get *wxPython* to install, you might try doing this:
+ > sudo apt-get install libgtk-2-dev
-Extract the files:
+ or
-::
+ > sudo apt-get install libgtk-3-dev
+ depending on which version of *libgtk* you have installed.
- tar -xvjf bwa-0.7.12.tar.bz2
+|
+Windows Instructions
+~~~~~~~~~~~~~~~~~~~~
-Go to the directory with the extracted source-code, and run make to create the executable files:
+For Windows, we provide a windows executable (.exe) for Windows 64 bit:
-::
+ + `bwa-0.7.12_windows.zip <http://saclab.tamu.edu/essentiality/transit/bwa-0.7.12_windows.zip>`_
- cd bwa-0.7.12
- make
+The 32-bit version of Windows is not recommended as it is limited in the amount of system memory that can be used.
-.. _bwa-win:
-Windows Instructions
-~~~~~~~~~~~~~~~~~~~~
+|
-For Windows, we provide a windows executable (.exe) for Windows 64 bit:
+.. _install-zinb:
- + `bwa-0.7.12_windows.zip <http://saclab.tamu.edu/essentiality/transit/bwa-0.7.12_windows.zip>`_
+Installing R (statistical analysis package) (optional)
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+R is called by Transit for certain commands, such as :ref:`ZINB <zinb>`, corrplot, and heatmap.
+As of now, installing R is optional, and requires these additional steps...
+Additional Installation Requirements for R:
-The 32-bit version of Windows is not recommended as it is limited in the amount of system memory that can be used.
+ - install `R <https://www.r-project.org/>`_ (tested on v3.5.2)
+ - R packages: **MASS, pscl, corrplot, gplots** (run "install.packages(MASS)" etc. in R console)
+ - Python packages (for python3): rpy2 (v>=3.0) (run "pip3 install rpy2" on command line)
+ - Python packages (for python2.7): rpy2 (v<2.9.0) (run "pip install 'rpy2<2.9.0' " on command line)
|
+
.. _transit-upgrade:
Upgrading
@@ -218,22 +239,27 @@ Method 1: Upgrading package installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-If you installed TRANSIT as a package, then to upgrade, simply use pip to install tnseq-transit again, but this time include the '--upgrade' flag. For example:
+If you installed TRANSIT as a package, then to upgrade, simply use pip to install 'transit1' again, but this time include the '--upgrade' flag. For example:
::
- sudo pip install tnseq-transit --upgrade
+ sudo pip install transit1 --upgrade
This will automatically download and install the latest version of TRANSIT, as well as upgrade any of its requirements if necessary for compatability.
+.. NOTE::
+ In Dec 2024, we switched the package name on PyPi from 'tnseq-transit' to 'transit1'. Hopefully, users who previously installed transit using 'tnseq-transit' should also be able to upgrade, and it will automatically upgrade to transit1. You might have to use this command: "sudo pip install tnseq-transit --upgrade' for your package name.
+
+
+
Method 2: Upgrading source installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you installed TRANSIT by downloading the raw source, then you can upgrade TRANSIT simply by replacing the old source code with the latest version. You can obtain a .zip archive with the latest version of the source through the following link:
-https://github.com/mad-lab/transit/archive/master.zip
+https://github.com/ioerger/transit/archive/master.zip
Simply exctract the code, and replace your existing files or delete the directory with the old source doe and use the newest version.
@@ -244,36 +270,6 @@ Simply exctract the code, and replace your existing files or delete the director
|
-.. _install-wxpython:
-
-Installing wxPython
--------------------
-
-wxPython 4+ can be installed using pip
-
-::
-
- pip install wxPython
-
-If the above command fails and you already have wxPython < 4.0 installed, you may have to manually remove it.
-See https://stackoverflow.com/questions/50688630/cannot-uninstall-wxpython-3-0-2-0-macos for details.
-
-.. NOTE::
-
- Installing *wxPython* can be a bit finicky. It might require installing the
- development version of GTK first. There are at least two versions currently,
- *gtk2* and *gtk3*.
- Transit should work with both, although there can be small differences in the
- visual look of the GUI. To get *wxPython* to install, you might try doing this:
-
- > sudo apt-get install libgtk-2-dev
-
- or
-
- > sudo apt-get install libgtk-3-dev
-
- depending on which version of *libgtk* you have installed.
-
.. _transit-troubleshoot:
Troubleshooting
=====================================
src/pytransit/doc/source/transit_running.rst
=====================================
@@ -90,51 +90,27 @@ See example usages of supported methods in :ref:`Analysis Methods <analysis_meth
|
-Prot_tables (Annotations)
--------------------------
-
-Most of the methods in Transit use a custom format for genome annotations called a '.prot_table'.
-It is a simple tab-separated text file with specific columns, as originally defined for genomes
-in Genbank many years ago.
-
-The required columns are:
-
-1. gene function description
-2. start coordinate
-3. end coordinate
-4. strand
-5. length of protein product (in amino acids)
-6. don't care
-7. don't care
-8. gene name (like "dnaA")
-9. ORF id (like Rv0001)
-
-It is crucial to use the same .prot_table corresponding to the genome sequence that was
-used to generate the wig file (count insertions) by TPP. This is because the
-coordinates of TA sites in the wig file and the coordinates of ORF boundaries
-must use the same coordinate system (which can be thrown out of register by indels).
-
-Suppose you have a .prot_table for genome A, and you want to map reads to
-another genome B which is closely related, but for which you do not have an annotation.
-You can use the following web-app ( `Prot_table Adjustment Tool <http://saclab.tamu.edu/cgi-bin/iutils/app.cgi>`_ )
-to convert the annotation for A to B
-by adjusting all the coordinates of ORFs from A to B according to a genome alignment.
-For example, you could use this to map known ORFs in H37Rv to sequences of other strains, like HN878 or CDC1551.
-(Even though they have their own annotations, it might be helpful to use the genes as defined in H37Rv)
-
-While some Transit methods can also work with .gff (or .gff3) files,
-the flexibility of the .gff format makes it difficult to anticipate all possible encoding schemes.
-Therefore, to simplify things, we recommend you convert your .gff file to .prot_table format
-once at the beginning and then use that for all work with Transit,
-which can be done through the GUI (under 'Convert' in menu), or on the command-line as follows:
+Use as a Python Package
+-----------------------------------------------------
+TRANSIT can be (optionally) installed as a python package. This can simplify the installation process as it will automatically install most of the requirements. In addition, it will allow users to use some of transit functions in their own scripts if they desire. Below is a brief example of importing transit functions into python. In this example, pair of .wig files are parsed into their read-counts (data) and genomic positions (position), and then normalization factors are calculated. See the documentation of the package for further examples:
+
::
- > python transit.py convert gff_to_prot_table <.gff> <.prot_table>
+ >>> import pytransit.norm_tools as norm_tools
+ >>> import pytransit.tnseq_tools as tnseq_tools
+ >>> (data, position) = tnseq_tools.get_data(["transit/data/glycerol_H37Rv_rep1.wig", "transit/data/glycerol_H37Rv_rep2.wig"])
+ >>> print(data)
+ array([[ 0., 0., 0., ..., 0., 0., 0.],
+ [ 0., 0., 0., ..., 0., 0., 0.]])
+ >>> factors = norm_tools.TTR_factors(data)
+ >>> print(factors)
+ array([[ 1. ],
+ [ 0.62862886]])
-|
+|
.. _tn5-main-overview:
=====================================
src/pytransit/generic_tools/__init__.py
=====================================
View it on GitLab: https://salsa.debian.org/med-team/tnseq-transit/-/compare/981144fe08658be8bfc1a9fea3553225d7192fad...0f7c76d4720d6988a34d5e1ac498514176c6b49a
--
View it on GitLab: https://salsa.debian.org/med-team/tnseq-transit/-/compare/981144fe08658be8bfc1a9fea3553225d7192fad...0f7c76d4720d6988a34d5e1ac498514176c6b49a
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20250203/b2a500ce/attachment-0001.htm>
More information about the debian-med-commit
mailing list