Skip to content

Commit

Permalink
Merge pull request #912 from mskcc/release/1.54.0
Browse files Browse the repository at this point in the history
Release 1.54.0
  • Loading branch information
sivkovic authored Aug 5, 2021
2 parents b5dc110 + c2b6f86 commit f605614
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 20 deletions.
2 changes: 1 addition & 1 deletion beagle/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.53.0"
__version__ = "1.54.0"
38 changes: 21 additions & 17 deletions beagle_etl/jobs/lims_etl_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,27 @@ def fetch_samples(request_id, import_pooled_normals=True, import_samples=True, j
raise FailedToFetchSampleException("No samples reported for requestId: %s" % request_id)

for sample in sample_ids.get('samples', []):
sampleMetadata = LIMSClient.get_sample_manifest(sample['igoSampleId'])
try:
data = sampleMetadata[0]
except Exception as e:
pass
patient_id = format_patient_id(data.get('cmoPatientId'))

if not Patient.objects.filter(patient_id=patient_id):
Patient.objects.create(patient_id=patient_id)

sample_name = data.get('cmoSampleName', None)
specimen_type = data.get('specimenType', None)
cmo_sample_name = format_sample_name(sample_name, specimen_type)

if not Sample.objects.filter(sample_id=sample['igoSampleId'],
sample_name=sample_name,
cmo_sample_name=cmo_sample_name):
Sample.objects.create(sample_id=sample['igoSampleId'],
sample_name=sample_name,
cmo_sample_name=cmo_sample_name)

job = create_sample_job(sample['igoSampleId'],
sample['igocomplete'],
request_id,
Expand Down Expand Up @@ -393,29 +414,12 @@ def fetch_sample_metadata(sample_id, igocomplete, request_id, request_metadata,
raise FailedToFetchSampleException(
"Failed to fetch SampleManifest for sampleId:%s. Invalid response" % sample_id)
if data['igoId'] != sample_id:
# logger.info(data)
logger.info("Failed to fetch SampleManifest for sampleId:%s. LIMS returned %s " % (sample_id, data['igoId']))
raise FailedToFetchSampleException(
"Failed to fetch SampleManifest for sampleId:%s. LIMS returned %s " % (sample_id, data['igoId']))

validate_sample(sample_id, data.get('libraries', []), igocomplete, redelivery)

patient_id = format_patient_id(data.get('cmoPatientId'))

if not Patient.objects.filter(patient_id=patient_id):
Patient.objects.create(patient_id=patient_id)

sample_name = data.get('cmoSampleName', None)
specimen_type = data.get('specimenType', None)
cmo_sample_name = format_sample_name(sample_name, specimen_type)

if not Sample.objects.filter(sample_id=sample_id,
sample_name=sample_name,
cmo_sample_name=cmo_sample_name):
Sample.objects.create(sample_id=sample_id,
sample_name=sample_name,
cmo_sample_name=cmo_sample_name)

libraries = data.pop('libraries')
for library in libraries:
logger.info("Processing library %s" % library)
Expand Down
18 changes: 18 additions & 0 deletions file_system/migrations/0027_auto_20210804_1508.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.24 on 2021-08-04 19:08

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('file_system', '0026_auto_20210729_0917'),
]

operations = [
migrations.AlterField(
model_name='sample',
name='sample_id',
field=models.CharField(max_length=32, unique=True),
),
]
2 changes: 1 addition & 1 deletion file_system/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Request(BaseModel):


class Sample(BaseModel):
sample_id = models.CharField(max_length=32, unique=False, null=False, blank=False)
sample_id = models.CharField(max_length=32, unique=True, null=False, blank=False)
sample_name = models.CharField(max_length=100, null=True, blank=True)
cmo_sample_name = models.CharField(max_length=100, null=True, blank=True)
redact = models.BooleanField(default=False, null=False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def get_descriptor(bait_set, pooled_normals, preservation_types, run_ids):

def get_sequencer_type(run_ids_list):
hiseq_machines = ['jax', 'pitt']
novaseq_machines = ['diana', 'michelle', 'aa00227']
novaseq_machines = ['diana', 'michelle', 'aa00227', 'ruth']
run_ids_lower = [ i.lower() for i in run_ids_list if i ]
for machine in hiseq_machines:
is_hiseq = find_substr(machine, run_ids_lower)
Expand Down

0 comments on commit f605614

Please sign in to comment.