searching on that on the public library index.
Additionally detect if we have an eland_multi or eland extended file
and make the url to download those different files. (and change the
link name slightly to reflect you're getting a different file.)
finally don't bother showing the bed downloader for newer file types
as the bed convertor doesn't work on them.
library_species = models.ForeignKey(Species)
# new field 2008 Mar 5, alter table samples_library add column "hidden" NOT NULL default 0;
hidden = models.BooleanField()
library_species = models.ForeignKey(Species)
# new field 2008 Mar 5, alter table samples_library add column "hidden" NOT NULL default 0;
hidden = models.BooleanField()
- cell_line = models.ForeignKey(Cellline)
- condition = models.ForeignKey(Condition)
+ cell_line = models.ForeignKey(Cellline, null=True)
+ condition = models.ForeignKey(Condition, null=True)
antibody = models.ForeignKey(Antibody,blank=True,null=True)
# New field Aug/25/08. SQL: alter table fctracker_library add column "lib_affiliation" varchar(256) NULL;
affiliations = models.ManyToManyField(Affiliation,related_name='library_affiliations',null=True)
antibody = models.ForeignKey(Antibody,blank=True,null=True)
# New field Aug/25/08. SQL: alter table fctracker_library add column "lib_affiliation" varchar(256) NULL;
affiliations = models.ManyToManyField(Affiliation,related_name='library_affiliations',null=True)
('Done', 'Completed'),
)
stopping_point = models.CharField(max_length=25, choices=PROTOCOL_END_POINTS, default='Done')
('Done', 'Completed'),
)
stopping_point = models.CharField(max_length=25, choices=PROTOCOL_END_POINTS, default='Done')
- amplified_from_sample = models.ForeignKey('self', blank=True, null=True)
+ amplified_from_sample = models.ForeignKey('self', blank=True, null=True, related_name='amplified_into_sample')
undiluted_concentration = models.DecimalField("Concentration",
max_digits=5, decimal_places=2, blank=True, null=True,
undiluted_concentration = models.DecimalField("Concentration",
max_digits=5, decimal_places=2, blank=True, null=True,
d[c_dir]['eland_results'] = {}
d[c_dir]['eland_results'] = {}
- result_filepaths = glob.glob(os.path.join(c_dir_path, 's_*_eland_result.txt*'))
+ result_filepaths = glob.glob(os.path.join(c_dir_path, 's_*_eland_*'))
for filepath in result_filepaths:
for filepath in result_filepaths:
summary['library_id'] = lib.library_id
summary['library_name'] = lib.library_name
summary['species_name' ] = lib.library_species.scientific_name
summary['library_id'] = lib.library_id
summary['library_name'] = lib.library_name
summary['species_name' ] = lib.library_species.scientific_name
+ if lib.amplified_from_sample is not None:
+ summary['amplified_from'] = lib.amplified_from_sample.library_id
+ else:
+ summary['amplified_from'] = ''
lanes_run = 0
for lane_id in LANE_LIST:
lane = getattr(lib, 'lane_%d_library' % (lane_id,))
lanes_run = 0
for lane_id in LANE_LIST:
lane = getattr(lib, 'lane_%d_library' % (lane_id,))
def library(request):
# build changelist
fcl = ChangeList(request, Library,
def library(request):
# build changelist
fcl = ChangeList(request, Library,
- list_filter=['library_species','affiliations'],
- search_fields=['library_id', 'library_name'],
+ list_filter=['affiliations', 'library_species'],
+ search_fields=['library_id', 'library_name', 'amplified_from_sample__library_id'],
list_per_page=200,
queryset=Library.objects.filter(hidden__exact=0)
)
list_per_page=200,
queryset=Library.objects.filter(hidden__exact=0)
)
return (dict_list, err_list, summary_list)
return (dict_list, err_list, summary_list)
+def get_eland_result_type(pathname):
+ """
+ Guess the eland result file type from the filename
+ """
+ path, filename = os.path.split(pathname)
+ if 'extended' in filename:
+ return 'extended'
+ elif 'multi' in filename:
+ return 'multi'
+ elif 'result' in filename:
+ return 'result'
+ else:
+ return 'unknown'
def _files(flowcell_id, lane):
"""
Sets up available files for download
"""
def _files(flowcell_id, lane):
"""
Sets up available files for download
"""
flowcell_id, id = parse_flowcell_id(flowcell_id)
d = get_flowcell_result_dict(flowcell_id)
flowcell_id, id = parse_flowcell_id(flowcell_id)
d = get_flowcell_result_dict(flowcell_id)
% (flowcell_id, c_name, c_name))
erd = d[c_name]['eland_results']
% (flowcell_id, c_name, c_name))
erd = d[c_name]['eland_results']
-
- if int(lane) in erd:
- output.append('<a href="/results/%s/%s/eland_result/%s">eland_result(%s)</a>' % (flowcell_id, c_name, lane, c_name))
- output.append('<a href="/results/%s/%s/bedfile/%s">bedfile(%s)</a>' % (flowcell_id, c_name, lane, c_name))
+ if lane in erd:
+ result_type = get_eland_result_type(erd[lane])
+ result_url_pattern = '<a href="/results/%s/%s/eland_result/%s">eland %s(%s)</a>'
+ output.append(result_url_pattern % (flowcell_id, c_name, lane, result_type, c_name))
+ if result_type == 'result':
+ bed_url_pattern = '<a href="/results/%s/%s/bedfile/%s">bedfile(%s)</a>'
+ output.append(bed_url_pattern % (flowcell_id, c_name, lane, c_name))
if len(output) == 0:
return ''
if len(output) == 0:
return ''
<td>Library ID</td>
<td>Species</td>
<td>Library Name</td>
<td>Library ID</td>
<td>Species</td>
<td>Library Name</td>
- {% for lib in library_list%}
+ {% for lib in library_list %}
+ <td><a href="/library/{{ lib.library_id }}">{{ lib.amplified_from }}</a></td>
<td><a href="/library/{{ lib.library_id }}">{{ lib.library_id }}</a></td>
<td><a href="/library/{{ lib.library_id }}">{{ lib.species_name }}</a></td>
<td><a href="/library/{{ lib.library_id }}">{{ lib.library_name }}</a></td>
<td><a href="/library/{{ lib.library_id }}">{{ lib.library_id }}</a></td>
<td><a href="/library/{{ lib.library_id }}">{{ lib.species_name }}</a></td>
<td><a href="/library/{{ lib.library_id }}">{{ lib.library_name }}</a></td>