Skip to content

Commit

Permalink
Merge pull request #33 from YeoLab/0711_updates
Browse files Browse the repository at this point in the history
updates and readme
  • Loading branch information
ekofman authored Jul 12, 2024
2 parents ac65b20 + cfed91e commit 108fa6e
Show file tree
Hide file tree
Showing 14 changed files with 599 additions and 394 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,22 @@ MARINE was developed and tested using Python 3.8.18 and is not guaranteed to wor
Use the provided .yml file to create a new conda environment that contains all required dependencies, including the proper Python version, for MARINE:

```
conda env create --file=marine_environment.yml
conda env create --file=marine_environment2.yaml
conda activate marine_environment
```

or if you encounter problems with this approach, try using mamba instead, which can be faster:

```
mamba create -n marine_environment python=3.8.18 -y
mamba env update -n marine_environment --file marine_environment2.yaml
conda activate marine_environment
```

Notes:
* The more cores used, the faster MARINE will run
* Ensure that your annotation bedfile has the same chromosome nomenclature (e.g., "9" vs "chr9") as your bam
* The annotation file should be tab-separated and should have a standard bed column ordering, as follows:
* The annotation bedfile should be tab-separated and should have a standard bed6 column ordering, as follows:
```
1 29554 31109 MIR1302-2HG lincRNA +
1 34554 36081 FAM138A lincRNA -
Expand Down
1 change: 1 addition & 0 deletions marine.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import tracemalloc
from matplotlib import pyplot as plt


sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'src/'))

from read_process import incorporate_replaced_pos_info,incorporate_insertions_and_deletions,\
Expand Down
2 changes: 1 addition & 1 deletion marine_environment2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ dependencies:
- python-json-logger=2.0.7=py38h06a4308_0
- python-tzdata=2023.3=pyhd3eb1b0_0
- python_abi=3.8=4_cp38
- pytz=2023.3.post1=py38h06a4308_0
- pytz
- pyyaml=6.0.1=py38h5eee18b_0
- pyzmq=25.1.0=py38h6a678d5_0
- qt-main=5.15.2=h53bd1ea_10
Expand Down
2 changes: 1 addition & 1 deletion marine_environment_3_10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ dependencies:
- pyopenssl
- pysam
- pysocks
- python
- python
- python-dateutil
- python-tzdata
- python_abi
Expand Down
19 changes: 10 additions & 9 deletions src/annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
import pandas as pd

import pybedtools
import os
import sys

bin_dir = os.path.dirname(sys.executable)
pybedtools.set_bedtools_path(bin_dir)

import pandas as pd


Expand All @@ -10,7 +16,7 @@ def make_bedtool_from_final_sites(df):
return pybedtools.BedTool.from_dataframe(df_bed_cols)


def get_strand_specific_conversion(r, reverse_stranded):
def get_strand_specific_conversion(r, strandedness):
ref_alt_dict = {
'A': 'T',
'T': 'A',
Expand All @@ -22,14 +28,9 @@ def get_strand_specific_conversion(r, reverse_stranded):
alt = r.alt
mapped_strand = r.strand

"""
if reverse_stranded:
if mapped_strand == '+':
mapped_strand = '-'
elif mapped_strand == '-':
mapped_strand = '+'
"""

if strandedness == 0:
return '{}>{}'.format(ref, alt)

if mapped_strand == '+':
return '{}>{}'.format(
ref,
Expand Down
Loading

0 comments on commit 108fa6e

Please sign in to comment.