Skip to content

Commit

Permalink
Merge pull request #38 from Illumina/develop
Browse files Browse the repository at this point in the history
Release 1.3.4
  • Loading branch information
mialam24 authored Dec 20, 2023
2 parents cb3ecbf + d23e499 commit d1579c9
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 21 deletions.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM python:3.9-slim

WORKDIR /opt/BeadArrayFiles/

# Installing ps to support usage in Nextflow ICA pipelines
RUN apt-get update && apt-get install -y --no-install-recommends procps

COPY . /opt/BeadArrayFiles/

RUN python setup.py install
RUN pip install --no-cache-dir numpy pandas scipy
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,21 @@ The library depends on the availability of the numpy package in the python insta

## Example usage

> from IlluminaBeadArrayFiles import GenotypeCalls, BeadPoolManifest, code2genotype
> import sys
> gtc_file = "path_to_genotypes.gtc"
> manifest_file = "path_to_manifest.bpm"
> names = BeadPoolManifest( manifest_file ).names
> genotypes = GenotypeCalls( gtc_file ).get_genotypes()
> for (locus, genotype) in zip( names, genotypes ):
>   sys.stdout.write( locus + "," + code2genotype[genotype] + "\n" )
```python
from IlluminaBeadArrayFiles import GenotypeCalls, BeadPoolManifest, code2genotype

gtc_file = "path_to_genotypes.gtc"
manifest_file = "path_to_manifest.bpm"
names = BeadPoolManifest( manifest_file ).names
genotypes = GenotypeCalls( gtc_file ).get_genotypes()

c = 0 # a counter to only show the first 10 genotypes
for (locus, genotype) in zip( names, genotypes ):
print( locus + "," + code2genotype[genotype] )
if c >= 10:
break
c += 1
```

Also, see examples/* for additional examples of usage.
These scripts are based on common Genome Studio (https://support.illumina.com/array/array_software/genomestudio.html) reports.
Expand Down
5 changes: 5 additions & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.3.4
-Fix for empty LocusAggregates. See issue #31 (https://github.com/Illumina/BeadArrayFiles/issues/31)
-Added Dockerfile to be used with ICA pipelines
-Added more support to read clusterfiles of different versions

1.3.3
-Updated to python3
-Added GenomeStudio-style dna_report to examples
Expand Down
24 changes: 15 additions & 9 deletions module/ClusterFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ def read_cluster_file(handle):
result = ClusterFile(gencall_version, cluster_version, call_version,
normalization_version, date_created, manifest_name)
data_block_version = read_int(handle)
if data_block_version not in [8, 9]:
raise Exception("Data block version in cluster file " +
str(data_block_version) + " not supported")
# opa
_ = read_string(handle)

Expand Down Expand Up @@ -211,17 +208,26 @@ def read_record(handle, version):

if version == 9:
intensity_threshold = read_float(handle)
elif version == 8:
_ = read_float(handle)

# read through unused fields
for idx in range(14):
_ = read_float(handle)
elif version >= 6:
intensity_threshold = 0

# read through unused fields
for idx in range(15):
_ = read_float(handle)
elif version < 5:
intensity_threshold = 0

# read through unused fields
_ = read_float(handle)
_ = read_float(handle)
else:
raise Exception(
"Unsupported cluster record version " + str(version))

# read through unused fields
for idx in range(14):
_ = read_float(handle)

aa_cluster_stats = ClusterStats(
aa_theta_mean, aa_theta_dev, aa_r_mean, aa_r_dev, aa_n)
ab_cluster_stats = ClusterStats(
Expand Down
4 changes: 2 additions & 2 deletions module/LocusAggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ def aggregate_samples(samples, loci, callback, normalization_lookups, bin_size=1
for loci_group in LocusAggregate.group_loci(loci, loci_batch_size):

# read in the buffer for this group of loci
buffer = LocusAggregate.load_buffer(
samples, loci_group[0], loci_group[-1] - loci_group[0] + 1, normalization_lookups)
buffer = list(LocusAggregate.load_buffer(
samples, loci_group[0], loci_group[-1] - loci_group[0] + 1, normalization_lookups))

# generate corresponding locus aggregates
aggregates = map(GenerateLocusAggregate(
Expand Down
2 changes: 1 addition & 1 deletion module/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# of the authors and should not be interpreted as representing official policies,
# either expressed or implied, of the FreeBSD Project.

__version__ = "1.3.3"
__version__ = "1.3.4"
from .GenotypeCalls import code2genotype, NC, AA, AB, BB, GenotypeCalls, NormalizationTransform, ScannerData
from .BeadPoolManifest import RefStrand, SourceStrand, BeadPoolManifest
from .LocusAggregate import LocusAggregate
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
author_email='[email protected]',
packages=['IlluminaBeadArrayFiles'],
package_dir={'IlluminaBeadArrayFiles' : 'module'},
version='1.3.3'
version='1.3.4'
)

0 comments on commit d1579c9

Please sign in to comment.