Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libsmallrna
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Blaise LI
libsmallrna
Commits
05edfb17
Commit
05edfb17
authored
6 years ago
by
Blaise Li
Browse files
Options
Downloads
Patches
Plain Diff
Moving small types definition in libsmallrna.
parent
27f617cc
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
libsmallrna/__init__.py
+7
-1
7 additions, 1 deletion
libsmallrna/__init__.py
libsmallrna/libsmallrna.pyx
+40
-1
40 additions, 1 deletion
libsmallrna/libsmallrna.pyx
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
48 additions
and
3 deletions
libsmallrna/__init__.py
+
7
−
1
View file @
05edfb17
...
@@ -3,4 +3,10 @@ from .libsmallrna import (
...
@@ -3,4 +3,10 @@ from .libsmallrna import (
count_small
,
count_small
,
count_annots
,
count_pimis
,
count_sis
,
count_all_sis
,
count_nucl
,
count_first_bases
,
count_annots
,
count_pimis
,
count_sis
,
count_all_sis
,
count_nucl
,
count_first_bases
,
add_compositions
,
add_results
,
Composition
,
get_read_info
,
add_compositions
,
add_results
,
Composition
,
get_read_info
,
PI_MIN
,
PI_MAX
,
SI_MIN
,
SI_MAX
)
PI_MIN
,
PI_MAX
,
SI_MIN
,
SI_MAX
SI_PREFIXES
,
SMALL_TYPES_TREE
,
types_under
,
SMALL_TYPES
,
SI_TYPES
,
SIU_TYPES
,
RMSK_SISIU_TYPES
)
This diff is collapsed.
Click to expand it.
libsmallrna/libsmallrna.pyx
+
40
−
1
View file @
05edfb17
...
@@ -40,11 +40,50 @@ from operator import add
...
@@ -40,11 +40,50 @@ from operator import add
from
functools
import
reduce
from
functools
import
reduce
#from pysam import AlignedSegment
#from pysam import AlignedSegment
#############################################
# Declaring small types and their hierarchy #
#############################################
RMSK_PREFIXES
=
[
"
te
"
,
"
satel
"
,
"
simrep
"
]
SI_PREFIXES
=
[
"
prot
"
,
"
pseu
"
]
+
RMSK_PREFIXES
# Should we have only non-overlapping sets ?
SMALL_TYPES_TREE
=
{
"
si
"
:
{
"
rmsk
"
:
[
prefix
+
"
_si
"
for
prefix
in
RMSK_PREFIXES
],
"
prot
"
:
[
"
prot_si
"
],
"
pseu
"
:
[
"
pseu_si
"
]},
"
siu
"
:
{
"
rmsk
"
:
[
prefix
+
"
_siu
"
for
prefix
in
RMSK_PREFIXES
],
"
prot
"
:
[
"
prot_siu
"
],
"
pseu
"
:
[
"
pseu_siu
"
]},
"
pi
"
:
[
"
pi
"
],
"
mi
"
:
[
"
mi
"
]
}
def
types_under
(
typekeys
,
tree
=
SMALL_TYPES_TREE
):
"""
Generate type names corresponding to the branching according to the
succession of keys *typekeys* in the *tree* dictionary of (ultimately)
lists.
"""
if
typekeys
:
yield
from
types_under
(
typekeys
[
1
:],
tree
[
typekeys
[
0
]])
else
:
if
isinstance
(
tree
,
dict
):
for
subtree
in
tree
.
values
():
yield
from
types_under
([],
subtree
)
else
:
yield
from
tree
SMALL_TYPES
=
list
(
types_under
([]))
SI_TYPES
=
list
(
types_under
([
"
si
"
]))
SIU_TYPES
=
list
(
types_under
([
"
siu
"
]))
RMSK_SISIU_TYPES
=
set
(
chain
(
types_under
([
"
si
"
,
"
rmsk
"
]),
types_under
([
"
siu
"
,
"
rmsk
"
])))
FQ_TEMPLATE
=
b
"
@%s
\n
%s
\n
+
\n
%s
\n
"
FQ_TEMPLATE
=
b
"
@%s
\n
%s
\n
+
\n
%s
\n
"
DNA_COMPL_TABLE
=
str
.
maketrans
(
"
ACGTRYSWKMBDHVN
"
,
"
TGCAYRWSMKVHDBN
"
)
DNA_COMPL_TABLE
=
str
.
maketrans
(
"
ACGTRYSWKMBDHVN
"
,
"
TGCAYRWSMKVHDBN
"
)
cdef
str
creverse_complement
(
str
seq
):
cdef
str
creverse_complement
(
str
seq
):
return
seq
.
translate
(
DNA_COMPL_TABLE
)[::
-
1
]
return
seq
.
translate
(
DNA_COMPL_TABLE
)[::
-
1
]
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
05edfb17
...
@@ -3,7 +3,7 @@ from Cython.Build import cythonize
...
@@ -3,7 +3,7 @@ from Cython.Build import cythonize
setup
(
setup
(
name
=
"
libsmallrna
"
,
name
=
"
libsmallrna
"
,
version
=
"
0.
1
"
,
version
=
"
0.
2
"
,
description
=
"
Miscellaneous things to deal with small RNA
"
,
description
=
"
Miscellaneous things to deal with small RNA
"
,
author
=
"
Blaise Li
"
,
author
=
"
Blaise Li
"
,
author_email
=
"
blaise.li@normalesup.org
"
,
author_email
=
"
blaise.li@normalesup.org
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment