fix composite images report

This commit is contained in:
Oleg Zharkov
2021-02-08 16:09:37 +01:00
parent 15b131f02e
commit 22c16d558d
3 changed files with 8 additions and 20 deletions
@@ -46,10 +46,7 @@ export default {
pathDestination.filepath
);
} else if (this.path === undefined || this.path === "undefined") {
this.directoryContent = this.removeParentDirectory(
pathDestination.datasetContent,
pathDestination.datasetRootDir
);
this.directoryContent = pathDestination.datasetContent
} else {
this.errorMessage = `is not found!`;
}
@@ -6,15 +6,11 @@ export const getPathDestination = async (history_dataset_id, path) => {
const services = new Services({ root: getAppRoot() });
const computePathDestination = (pathDestination) => {
if (pathDestination.datasetContent[0].class === "Directory")
pathDestination.datasetRootDir = datasetContent[0].path;
else return;
if (path === undefined || path === "undefined") {
return pathDestination;
}
const filepath = `${pathDestination.datasetRootDir}/${path}`;
const filepath = path;
const datasetEntry = datasetContent.find((datasetEntry) => {
return filepath === datasetEntry.path;
+6 -11
View File
@@ -49,6 +49,7 @@ ARG_VAL_CAPTURED_REGEX = r'''(?:([\w_\-\|]+)|\"([^\"]+)\"|\'([^\']+)\')'''
OUTPUT_LABEL_PATTERN = re.compile(r'output=\s*%s\s*' % ARG_VAL_CAPTURED_REGEX)
INPUT_LABEL_PATTERN = re.compile(r'input=\s*%s\s*' % ARG_VAL_CAPTURED_REGEX)
STEP_LABEL_PATTERN = re.compile(r'step=\s*%s\s*' % ARG_VAL_CAPTURED_REGEX)
PATH_LABEL_PATTERN = re.compile(r'path=\s*%s\s*' % ARG_VAL_CAPTURED_REGEX)
# STEP_OUTPUT_LABEL_PATTERN = re.compile(r'step_output=([\w_\-]+)/([\w_\-]+)')
UNENCODED_ID_PATTERN = re.compile(r'(workflow_id|history_dataset_id|history_dataset_collection_id|job_id|invocation_id)=([\d]+)')
ENCODED_ID_PATTERN = re.compile(r'(workflow_id|history_dataset_id|history_dataset_collection_id|job_id|invocation_id)=([a-z0-9]+)')
@@ -386,21 +387,15 @@ class ToBasicMarkdownDirectiveHandler(GalaxyInternalMarkdownDirectiveHandler):
def handle_dataset_as_image(self, line, hda):
dataset = hda.dataset
print("!!!!!!!!!!!")
print("!!!!!!!!!!!")
print("!!!!!!!!!!!")
print("!!!!!!!!!!!")
print("!!!!!!!!!!!")
print("!!!!!!!!!!!")
print("!!!!!!!!!!!")
print(line)
name = hda.name or ''
filepath = re.search(PATH_LABEL_PATTERN, line).group(2)
if "path" in line:
file = os.path.join(hda.extra_files_path, 'GSM461178_untreat_paired_subset_1_fastq_fastqc/Images/per_sequence_quality.png')
file = os.path.join(hda.extra_files_path, filepath)
else:
file = dataset.file_name
with open(file, "rb") as f:
base64_image_data = base64.b64encode(f.read()).decode("utf-8")
rval = (f"![{name}](data:image/png;base64,{base64_image_data})", True)