Skip to content

Commit

Permalink
Merge pull request #597 from macs3-project/doc/macs3/3.0.0b4
Browse files Browse the repository at this point in the history
MACS3 3.0.0 official release with docs updated
  • Loading branch information
taoliu authored Nov 15, 2023
2 parents 429f8f8 + 9f25975 commit ae83986
Show file tree
Hide file tree
Showing 31 changed files with 2,043 additions and 748 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**System (please complete the following information):**
- OS: [e.g. Linux, Mac OSX]
- OS: [e.g. Linux, Mac OSX] [note: Windows NOT supported]
- Python version [e.g. 3.7.1]
- Numpy version [e.g. 1.17.0]
- MACS Version [e.g. 2.2.4]
Expand Down
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/windows_issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Windows issues
about: Windows OS is not supported
title: 'Windows machine: '
labels: 'Windows'
assignees: ''

---

**Please Note**
Before opening a bug report, please take note: Windows OS is not supported, MACS is recommended to be used with either LinuxOS or MacOS.

Some users have had success running through a virtual environment, discussed here:
- [#539](https://github.com/macs3-project/MACS/issues/539)
- [#540](https://github.com/macs3-project/MACS/issues/540)
- [#444](https://github.com/macs3-project/MACS/issues/444)
- [#441](https://github.com/macs3-project/MACS/issues/441)




13 changes: 11 additions & 2 deletions .github/workflows/build-and-test-MACS3-macos12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@

name: MACS3 CI MacOS 12

on: [push, pull_request]

on:
push:
paths-ignore:
- 'docs/**'
- '*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'

jobs:
build:
runs-on: macos-12
name: Build on MacOS 12 with Python 3.11

steps:
- name: Checkout MACS
uses: actions/checkout@v3
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/build-and-test-MACS3-non-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@

name: MACS3 CI non x64

on: [push, pull_request]

on:
push:
paths-ignore:
- 'docs/**'
- '*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
jobs:
build_job:
runs-on: ubuntu-20.04
Expand All @@ -25,6 +32,7 @@ jobs:
uses: actions/checkout@v3
with:
submodules: 'true'

- name: Set up arch and run (bullseye Python 3.9)
uses: uraimo/run-on-arch-action@v2
id: build
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/build-and-test-MACS3-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@

name: MACS3 CI x64

on: [push, pull_request]

on:
push:
paths-ignore:
- 'docs/**'
- '*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.9, 3.10.11, 3.11]
python-version: [3.9, 3.10.11, 3.11, 3.12]
arch: ['x64']
name: Build on x64 with Python ${{ matrix.python-version }}
steps:
Expand Down
4 changes: 2 additions & 2 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
2023-07-28 Tao Liu <[email protected]>
MACS 3.0.0b3
2023-11-14 Tao Liu <[email protected]>
MACS 3.0.0

* New features in MACS3:

Expand Down
4 changes: 2 additions & 2 deletions MACS3/Commands/bdgpeakcall_cmd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Time-stamp: <2019-09-25 10:04:08 taoliu>
# Time-stamp: <2023-11-02 11:52:48 Tao Liu>

"""Description: Naive call peaks from a single bedGraph track for
scores.
Expand Down Expand Up @@ -43,7 +43,7 @@ def run( options ):

if options.cutoff_analysis:
info("Analyze cutoff vs number of peaks/total length of peaks/average length of peak")
cutoff_analysis_result = btrack.cutoff_analysis( int(options.maxgap), int(options.minlen), 50 )
cutoff_analysis_result = btrack.cutoff_analysis( int(options.maxgap), int(options.minlen), min_score = btrack.minvalue, max_score = btrack.maxvalue, steps = int(options.cutoff_analysis_steps) )
info("Write report...")
if options.ofile:
fhd = open( os.path.join( options.outdir, options.ofile ), 'w' )
Expand Down
61 changes: 44 additions & 17 deletions MACS3/Signal/BedGraph.pyx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cython: language_level=3
# cython: profile=True
# Time-stamp: <2023-07-28 12:06:48 Tao Liu>
# Time-stamp: <2023-11-02 11:40:47 Tao Liu>

"""Module for BedGraph data class.
Expand Down Expand Up @@ -96,9 +96,9 @@ cdef class bedGraphTrackI:
"""
cdef:
dict __data
float32_t maxvalue
float32_t minvalue
float32_t baseline_value
public float32_t maxvalue
public float32_t minvalue
public float32_t baseline_value

def __init__ (self, float32_t baseline_value=0 ):
"""
Expand Down Expand Up @@ -194,7 +194,7 @@ cdef class bedGraphTrackI:
if value > self.maxvalue:
self.maxvalue = value
if value < self.minvalue:
self.minvalue = value
self.minvalue = value

cpdef add_chrom_data( self, bytes chromosome, object p, object v ):
"""Add a pv data to a chromosome. Replace the previous data.
Expand Down Expand Up @@ -1131,30 +1131,57 @@ cdef class bedGraphTrackI:
#ret.merge_regions()
return ret

cpdef str cutoff_analysis ( self, int32_t max_gap, int32_t min_length, int32_t steps = 100, float32_t max_score = 1000 ):
cpdef str cutoff_analysis ( self, int32_t max_gap, int32_t min_length, int32_t steps = 100, float32_t min_score = 0, float32_t max_score = 1000 ):
"""
Cutoff analysis function for bedGraphTrackI object.
This function will try all possible cutoff values on the score column to call peaks. Then
will give a report of a number of metrics (number of peaks, total length of peaks, average
length of peak) at varying score cutoffs. For each score cutoff, the function finds the
positions where the score exceeds the cutoff, then groups those positions into "peaks"
based on the maximum allowed gap (max_gap) between consecutive positions. If a peak's length
exceeds the minimum length (min_length), the peak is counted.
This function will try all possible cutoff values on the score
column to call peaks. Then will give a report of a number of
metrics (number of peaks, total length of peaks, average
length of peak) at varying score cutoffs. For each score
cutoff, the function finds the positions where the score
exceeds the cutoff, then groups those positions into "peaks"
based on the maximum allowed gap (max_gap) between consecutive
positions. If a peak's length exceeds the minimum length
(min_length), the peak is counted.
Parameters
----------
max_gap : int32_t
Maximum allowed gap between consecutive positions above cutoff
min_length : int32_t
Minimum length of peak
min_length : int32_t Minimum length of peak
steps: int32_t
It will be used to calculate 'step' to increase from min_v to
max_v (see below).
min_score: float32_t
Minimum score for cutoff analysis. Note1: we will take the
larger value between the actual minimum value in the BedGraph
and min_score as min_v. Note2: the min_v won't be included in
the final result. We will try to output the smallest cutoff as
min_v+step.
max_score: float32_t
Maximum score for cutoff analysis. Note1: we will take the
smaller value between the actual maximum value in the BedGraph
and max_score as max_v. Note2: the max_v may not be included
in the final result. We will only output the cutoff that can
generate at least 1 peak.
Returns
-------
Cutoff analysis report in 'str'
Cutoff analysis report in str object.
Todos
-----
May need to seperate this function out as a class so that we
can add more ways to analyze the result. Also, we can let this
function return a list of dictionary or data.frame in that
way, instead of str object.
"""
cdef:
Expand All @@ -1171,7 +1198,7 @@ cdef class bedGraphTrackI:

#midvalue = self.minvalue/2 + self.maxvalue/2
#s = float(self.minvalue - midvalue)/steps
minv = max( 0, self.minvalue )
minv = max( min_score, self.minvalue )
maxv = min( self.maxvalue, max_score )

s = float(maxv - minv)/steps
Expand Down
2 changes: 1 addition & 1 deletion MACS3/Utilities/Constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MACS_VERSION = "3.0.0b4"
MACS_VERSION = "3.0.0"
MAX_PAIRNUM = 1000
MAX_LAMBDA = 100000
FESTEP = 20
Expand Down
Loading

0 comments on commit ae83986

Please sign in to comment.