index
int64
0
50.7k
project_path
stringclasses
279 values
completion_path
stringlengths
57
199
signature_postion
stringlengths
3
11
class_position
stringlengths
3
11
function_name
stringlengths
1
62
class_name
stringlengths
0
55
body_position
stringlengths
3
11
body_position_with_comments
stringlengths
3
11
masked_class
stringlengths
14
8.32k
masked_class_with_comment
stringlengths
14
8.32k
func_body
stringlengths
9
6.72k
func_body_with_comment
stringlengths
9
6.72k
len_func_body
int64
1
643
len_input
int64
10
2.02k
len_output
int64
4
1.9k
total
int64
20
2.05k
file_code
stringlengths
14
442k
file_code_with_comment
stringlengths
14
442k
45,586
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/larch.py
211,212
123,219
set_peek
FEFFInput
212,219
212,219
@build_sniff_from_prefix class FEFFInput(Text): """ FEFF input format """ file_ext = "inp" MetadataElement( name="title_block", desc="Title block", readonly=True, visible=True, ) def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ T...
@build_sniff_from_prefix class FEFFInput(Text): """ FEFF input format """ file_ext = "inp" MetadataElement( name="title_block", desc="Title block", readonly=True, visible=True, ) def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ T...
if not dataset.dataset.purged: dataset.peek = get_file_peek(dataset.get_file_name()) dataset.info = dataset.metadata.title_block else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
if not dataset.dataset.purged: dataset.peek = get_file_peek(dataset.get_file_name()) dataset.info = dataset.metadata.title_block else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
22
912
85
997
from typing import List from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, get_headers, ) @build_sniff_fro...
from typing import List from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, get_headers, ) @build_sniff_fro...
45,588
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/media.py
75,76
35,89
set_meta
Audio
76,89
76,89
class Audio(Binary): MetadataElement( name="duration", default=0, desc="Length of audio sample", readonly=True, visible=True, optional=True, no_value=0, ) MetadataElement( name="audio_codecs", default=[], desc="Audio codec(s)", ...
class Audio(Binary): MetadataElement( name="duration", default=0, desc="Length of audio sample", readonly=True, visible=True, optional=True, no_value=0, ) MetadataElement( name="audio_codecs", default=[], desc="Audio codec(s)", ...
if which("ffprobe"): metadata, streams = ffprobe(dataset.get_file_name()) dataset.metadata.duration = metadata["duration"] dataset.metadata.audio_codecs = [ stream["codec_name"] for stream in streams if stream["codec_type"] == "audio" ] ...
if which("ffprobe"): metadata, streams = ffprobe(dataset.get_file_name()) dataset.metadata.duration = metadata["duration"] dataset.metadata.audio_codecs = [ stream["codec_name"] for stream in streams if stream["codec_type"] == "audio" ] ...
46
303
159
462
"""Video classes""" import json import subprocess import wave from functools import lru_cache from typing import ( List, Tuple, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol ...
"""Video classes""" import json import subprocess import wave from functools import lru_cache from typing import ( List, Tuple, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol ...
45,589
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/media.py
210,211
207,217
sniff
Flv
211,217
211,217
class Flv(Video): file_ext = "flv" def sniff(self, filename: str) -> bool: FILL_FUNC_BODY
class Flv(Video): file_ext = "flv" def sniff(self, filename: str) -> bool: FILL_FUNC_BODY
if which("ffprobe"): metadata, streams = ffprobe(filename) return "flv" in metadata["format_name"].split(",") return False
if which("ffprobe"): metadata, streams = ffprobe(filename) return "flv" in metadata["format_name"].split(",") return False
12
44
50
94
"""Video classes""" import json import subprocess import wave from functools import lru_cache from typing import ( List, Tuple, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol ...
"""Video classes""" import json import subprocess import wave from functools import lru_cache from typing import ( List, Tuple, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol ...
45,590
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/media.py
183,184
180,190
sniff
Mkv
184,190
184,190
class Mkv(Video): file_ext = "mkv" def sniff(self, filename: str) -> bool: FILL_FUNC_BODY
class Mkv(Video): file_ext = "mkv" def sniff(self, filename: str) -> bool: FILL_FUNC_BODY
if which("ffprobe"): metadata, streams = ffprobe(filename) return "matroska" in metadata["format_name"].split(",") return False
if which("ffprobe"): metadata, streams = ffprobe(filename) return "matroska" in metadata["format_name"].split(",") return False
12
45
52
97
"""Video classes""" import json import subprocess import wave from functools import lru_cache from typing import ( List, Tuple, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol ...
"""Video classes""" import json import subprocess import wave from functools import lru_cache from typing import ( List, Tuple, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol ...
45,591
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/media.py
239,240
227,246
sniff
Mp3
240,246
240,246
class Mp3(Audio): """ Class that reads MP3 audio file. >>> from galaxy.datatypes.sniff import sniff_with_cls >>> sniff_with_cls(Mp3, 'audio_2.mp3') True >>> sniff_with_cls(Mp3, 'audio_1.wav') False """ file_ext = "mp3" def sniff(self, filename: str) -> bool: FILL_FUNC_BODY
class Mp3(Audio): """ Class that reads MP3 audio file. >>> from galaxy.datatypes.sniff import sniff_with_cls >>> sniff_with_cls(Mp3, 'audio_2.mp3') True >>> sniff_with_cls(Mp3, 'audio_1.wav') False """ file_ext = "mp3" def sniff(self, filename: str) -> bool: FILL_FUNC_BODY
if which("ffprobe"): metadata, streams = ffprobe(filename) return "mp3" in metadata["format_name"].split(",") return False
if which("ffprobe"): metadata, streams = ffprobe(filename) return "mp3" in metadata["format_name"].split(",") return False
12
131
50
181
"""Video classes""" import json import subprocess import wave from functools import lru_cache from typing import ( List, Tuple, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol ...
"""Video classes""" import json import subprocess import wave from functools import lru_cache from typing import ( List, Tuple, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol ...
45,592
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/media.py
200,201
190,207
sniff
Mp4
201,207
201,207
class Mp4(Video): """ Class that reads MP4 video file. >>> from galaxy.datatypes.sniff import sniff_with_cls >>> sniff_with_cls(Mp4, 'video_1.mp4') True """ file_ext = "mp4" def sniff(self, filename: str) -> bool: FILL_FUNC_BODY
class Mp4(Video): """ Class that reads MP4 video file. >>> from galaxy.datatypes.sniff import sniff_with_cls >>> sniff_with_cls(Mp4, 'video_1.mp4') True """ file_ext = "mp4" def sniff(self, filename: str) -> bool: FILL_FUNC_BODY
if which("ffprobe"): metadata, streams = ffprobe(filename) return "mp4" in metadata["format_name"].split(",") return False
if which("ffprobe"): metadata, streams = ffprobe(filename) return "mp4" in metadata["format_name"].split(",") return False
12
106
50
156
"""Video classes""" import json import subprocess import wave from functools import lru_cache from typing import ( List, Tuple, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol ...
"""Video classes""" import json import subprocess import wave from functools import lru_cache from typing import ( List, Tuple, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol ...
45,593
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/media.py
220,221
217,227
sniff
Mpg
221,227
221,227
class Mpg(Video): file_ext = "mpg" def sniff(self, filename: str) -> bool: FILL_FUNC_BODY
class Mpg(Video): file_ext = "mpg" def sniff(self, filename: str) -> bool: FILL_FUNC_BODY
if which("ffprobe"): metadata, streams = ffprobe(filename) return "mpegvideo" in metadata["format_name"].split(",") return False
if which("ffprobe"): metadata, streams = ffprobe(filename) return "mpegvideo" in metadata["format_name"].split(",") return False
12
44
51
95
"""Video classes""" import json import subprocess import wave from functools import lru_cache from typing import ( List, Tuple, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol ...
"""Video classes""" import json import subprocess import wave from functools import lru_cache from typing import ( List, Tuple, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol ...
45,594
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/media.py
161,162
89,180
set_meta
Video
162,180
162,180
class Video(Binary): MetadataElement( name="resolution_w", default=0, desc="Width of video stream", readonly=True, visible=True, optional=True, no_value=0, ) MetadataElement( name="resolution_h", default=0, desc="Height of video...
class Video(Binary): MetadataElement( name="resolution_w", default=0, desc="Width of video stream", readonly=True, visible=True, optional=True, no_value=0, ) MetadataElement( name="resolution_h", default=0, desc="Height of video...
if which("ffprobe"): metadata, streams = ffprobe(dataset.get_file_name()) (w, h, fps) = self._get_resolution(streams) dataset.metadata.resolution_w = w dataset.metadata.resolution_h = h dataset.metadata.fps = fps dataset.metadata.audio_cod...
if which("ffprobe"): metadata, streams = ffprobe(dataset.get_file_name()) (w, h, fps) = self._get_resolution(streams) dataset.metadata.resolution_w = w dataset.metadata.resolution_h = h dataset.metadata.fps = fps dataset.metadata.audio_cod...
68
596
237
833
"""Video classes""" import json import subprocess import wave from functools import lru_cache from typing import ( List, Tuple, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol ...
"""Video classes""" import json import subprocess import wave from functools import lru_cache from typing import ( List, Tuple, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol ...
45,595
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/media.py
280,281
246,290
set_meta
Wav
282,290
281,290
class Wav(Audio): """Class that reads WAV audio file >>> from galaxy.datatypes.sniff import sniff_with_cls >>> sniff_with_cls(Wav, 'hello.wav') True >>> sniff_with_cls(Wav, 'audio_2.mp3') False >>> sniff_with_cls(Wav, 'drugbank_drugs.cml') False """ file_ext = "wav" blurb = ...
class Wav(Audio): """Class that reads WAV audio file >>> from galaxy.datatypes.sniff import sniff_with_cls >>> sniff_with_cls(Wav, 'hello.wav') True >>> sniff_with_cls(Wav, 'audio_2.mp3') False >>> sniff_with_cls(Wav, 'drugbank_drugs.cml') False """ file_ext = "wav" blurb = ...
try: with wave.open(dataset.dataset.get_file_name(), "rb") as fd: dataset.metadata.rate = fd.getframerate() dataset.metadata.nframes = fd.getnframes() dataset.metadata.sampwidth = fd.getsampwidth() dataset.metadata.nchannels = fd.getnch...
"""Set the metadata for this dataset from the file contents.""" try: with wave.open(dataset.dataset.get_file_name(), "rb") as fd: dataset.metadata.rate = fd.getframerate() dataset.metadata.nframes = fd.getnframes() dataset.metadata.sampwidth = ...
21
451
113
564
"""Video classes""" import json import subprocess import wave from functools import lru_cache from typing import ( List, Tuple, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol ...
"""Video classes""" import json import subprocess import wave from functools import lru_cache from typing import ( List, Tuple, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol ...
45,596
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/metacyto.py
18,19
13,29
sniff_prefix
mStats
20,29
19,29
class mStats(Tabular): """Class describing the table of cluster statistics output from MetaCyto""" file_ext = "metacyto_stats.txt" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
class mStats(Tabular): """Class describing the table of cluster statistics output from MetaCyto""" file_ext = "metacyto_stats.txt" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """Quick test on file headings""" FILL_FUNC_BODY
if file_prefix.startswith("fcs_files\tcluster_id\tlabel\tfcs_names"): header_line = file_prefix.string_io().readline() if header_line.strip().split("\t")[-1] == "fraction": return True elif file_prefix.truncated and file_prefix.string_io().read() == header_lin...
"""Quick test on file headings""" if file_prefix.startswith("fcs_files\tcluster_id\tlabel\tfcs_names"): header_line = file_prefix.string_io().readline() if header_line.strip().split("\t")[-1] == "fraction": return True elif file_prefix.truncated and fi...
21
84
117
201
""" MetaCyto analysis datatypes. """ import logging from galaxy.datatypes.sniff import FilePrefix from galaxy.datatypes.tabular import Tabular log = logging.getLogger(__name__) class mStats(Tabular): """Class describing the table of cluster statistics output from MetaCyto""" file_ext = "metacyto_stats.txt...
""" MetaCyto analysis datatypes. """ import logging from galaxy.datatypes.sniff import FilePrefix from galaxy.datatypes.tabular import Tabular log = logging.getLogger(__name__) class mStats(Tabular): """Class describing the table of cluster statistics output from MetaCyto""" file_ext = "metacyto_stats.txt...
45,597
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/metacyto.py
34,35
29,36
sniff_prefix
mSummary
35,36
35,36
class mSummary(Tabular): """Class describing the summary table output by MetaCyto after FCS preprocessing""" file_ext = "metacyto_summary.txt" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
class mSummary(Tabular): """Class describing the summary table output by MetaCyto after FCS preprocessing""" file_ext = "metacyto_summary.txt" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
return file_prefix.startswith("study_id\tantibodies\tfilenames")
return file_prefix.startswith("study_id\tantibodies\tfilenames")
2
77
27
104
""" MetaCyto analysis datatypes. """ import logging from galaxy.datatypes.sniff import FilePrefix from galaxy.datatypes.tabular import Tabular log = logging.getLogger(__name__) class mStats(Tabular): """Class describing the table of cluster statistics output from MetaCyto""" file_ext = "metacyto_stats.txt...
""" MetaCyto analysis datatypes. """ import logging from galaxy.datatypes.sniff import FilePrefix from galaxy.datatypes.tabular import Tabular log = logging.getLogger(__name__) class mStats(Tabular): """Class describing the table of cluster statistics output from MetaCyto""" file_ext = "metacyto_stats.txt...
45,598
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/microarrays.py
105,106
95,137
sniff_prefix
Gal
117,120
106,120
@build_sniff_from_prefix class Gal(GenericMicroarrayFile): """Gal File format described at: http://mdc.custhelp.com/app/answers/detail/a_id/18883/#gal """ edam_format = "format_3829" edam_data = "data_3110" file_ext = "gal" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC...
@build_sniff_from_prefix class Gal(GenericMicroarrayFile): """Gal File format described at: http://mdc.custhelp.com/app/answers/detail/a_id/18883/#gal """ edam_format = "format_3829" edam_data = "data_3110" file_ext = "gal" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: "...
headers = get_headers(file_prefix, sep="\t", count=3) return "ATF" in headers[0][0] and "GenePix ArrayList" in headers[2][0]
""" Try to guess if the file is a Gal file. >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('test.gal') >>> Gal().sniff(fname) True >>> fname = get_test_fname('test.gpr') >>> Gal().sniff(fname) False """ ...
14
529
55
584
import logging from galaxy.datatypes import data from galaxy.datatypes.binary import Cel # noqa: F401 from galaxy.datatypes.data import get_file_peek from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_p...
import logging from galaxy.datatypes import data from galaxy.datatypes.binary import Cel # noqa: F401 from galaxy.datatypes.data import get_file_peek from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_p...
45,599
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/microarrays.py
80,81
17,95
set_peek
GenericMicroarrayFile
81,91
81,91
class GenericMicroarrayFile(data.Text): """ Abstract class for most of the microarray files. """ MetadataElement( name="version_number", default="1.0", desc="Version number", readonly=True, visible=True, optional=True, no_value="1.0", ) Me...
class GenericMicroarrayFile(data.Text): """ Abstract class for most of the microarray files. """ MetadataElement( name="version_number", default="1.0", desc="Version number", readonly=True, visible=True, optional=True, no_value="1.0", ) Me...
if not dataset.dataset.purged: if dataset.metadata.block_count == 1: dataset.blurb = f"{dataset.metadata.file_type} {dataset.metadata.version_number}: Format {dataset.metadata.file_format}, 1 block, {dataset.metadata.number_of_optional_header_records} headers and {dataset.metadata.nu...
if not dataset.dataset.purged: if dataset.metadata.block_count == 1: dataset.blurb = f"{dataset.metadata.file_type} {dataset.metadata.version_number}: Format {dataset.metadata.file_format}, 1 block, {dataset.metadata.number_of_optional_header_records} headers and {dataset.metadata.nu...
50
524
247
771
import logging from galaxy.datatypes import data from galaxy.datatypes.binary import Cel # noqa: F401 from galaxy.datatypes.data import get_file_peek from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_p...
import logging from galaxy.datatypes import data from galaxy.datatypes.binary import Cel # noqa: F401 from galaxy.datatypes.data import get_file_peek from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_p...
45,600
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/microarrays.py
147,148
137,173
sniff_prefix
Gpr
159,162
148,162
@build_sniff_from_prefix class Gpr(GenericMicroarrayFile): """Gpr File format described at: http://mdc.custhelp.com/app/answers/detail/a_id/18883/#gpr """ edam_format = "format_3829" edam_data = "data_3110" file_ext = "gpr" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC...
@build_sniff_from_prefix class Gpr(GenericMicroarrayFile): """Gpr File format described at: http://mdc.custhelp.com/app/answers/detail/a_id/18883/#gpr """ edam_format = "format_3829" edam_data = "data_3110" file_ext = "gpr" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: "...
headers = get_headers(file_prefix, sep="\t", count=3) return "ATF" in headers[0][0] and "GenePix Results" in headers[2][0]
""" Try to guess if the file is a Gpr file. >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('test.gpr') >>> Gpr().sniff(fname) True >>> fname = get_test_fname('test.gal') >>> Gpr().sniff(fname) False """ ...
14
445
55
500
import logging from galaxy.datatypes import data from galaxy.datatypes.binary import Cel # noqa: F401 from galaxy.datatypes.data import get_file_peek from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_p...
import logging from galaxy.datatypes import data from galaxy.datatypes.binary import Cel # noqa: F401 from galaxy.datatypes.data import get_file_peek from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_p...
45,602
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
243,244
202,332
set_meta
AtomicStructFile
247,289
244,289
class AtomicStructFile(GenericMolFile): """ Abstract class for structure files which use the ASE IO library for metadata. """ meta_error = False file_ext = "" ase_format = "" MetadataElement( name="atom_data", default=[], desc="Atom symbols and positions", r...
class AtomicStructFile(GenericMolFile): """ Abstract class for structure files which use the ASE IO library for metadata. """ meta_error = False file_ext = "" ase_format = "" MetadataElement( name="atom_data", default=[], desc="Atom symbols and positions", r...
self.meta_error = False if ase_io is None: # Don't have optional dependency, can't set advanced values return else: # enhanced metadata try: ase_data = ase_io.read(dataset.get_file_name(), index=":", format=self.ase_format) ...
""" Find Atom IDs for metadata. """ self.meta_error = False if ase_io is None: # Don't have optional dependency, can't set advanced values return else: # enhanced metadata try: ase_data = ase_io.read(dataset....
132
923
528
1,451
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,603
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
995,996
986,1037
sniff_prefix
CIF
1017,1037
996,1037
@build_sniff_from_prefix class CIF(AtomicStructFile): """ CIF format. """ file_ext = "cif" ase_format = "cif" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
@build_sniff_from_prefix class CIF(AtomicStructFile): """ CIF format. """ file_ext = "cif" ase_format = "cif" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Try to guess if the file is a CIF file. The CIF format and the Relion STAR format have a shared or...
# check for optional CIF version marker '#\#CIF_<version>' at start of file if file_prefix.startswith("#\\#CIF_"): return True # no version marker, search for mandatory CIF keywords # first non-comment line must begin with 'data_' # and '_atom_site_fract_(x|y|z)' mu...
""" Try to guess if the file is a CIF file. The CIF format and the Relion STAR format have a shared origin. Note therefore that STAR files and the STAR sniffer also use ``data_`` blocks. STAR files will not pass the CIF sniffer, but CIF files can pass the STAR sniffer. ...
75
334
216
550
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,604
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
1417,1419
1364,1513
split
CML
1422,1477
1419,1477
@build_sniff_from_prefix class CML(GenericXml): """ Chemical Markup Language http://cml.sourceforge.net/ """ file_ext = "cml" MetadataElement( name="number_of_molecules", default=0, desc="Number of molecules", readonly=True, visible=True, optional...
@build_sniff_from_prefix class CML(GenericXml): """ Chemical Markup Language http://cml.sourceforge.net/ """ file_ext = "cml" MetadataElement( name="number_of_molecules", default=0, desc="Number of molecules", readonly=True, visible=True, optional...
if split_params is None: return None if len(input_datasets) > 1: raise Exception("CML-file splitting does not support multiple files") input_files = [ds.get_file_name() for ds in input_datasets] chunk_size = None if split_params["split_mode"] == "number_...
""" Split the input files by molecule records. """ if split_params is None: return None if len(input_datasets) > 1: raise Exception("CML-file splitting does not support multiple files") input_files = [ds.get_file_name() for ds in input_datasets] ...
151
1,063
772
1,835
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,605
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
959,960
950,986
sniff_prefix
Cell
977,986
960,986
@build_sniff_from_prefix class Cell(AtomicStructFile): """ CASTEP CELL format. """ file_ext = "cell" ase_format = "castep-cell" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
@build_sniff_from_prefix class Cell(AtomicStructFile): """ CASTEP CELL format. """ file_ext = "cell" ase_format = "castep-cell" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Try to guess if the file is a CASTEP CELL file. A fingerprint for CELL files is ...
start_found = False for line in file_prefix.line_iterator(): if not start_found and line.lower().startswith("%block"): start_found = True elif start_found and line.lower().startswith("%endblock"): return True return False
""" Try to guess if the file is a CASTEP CELL file. A fingerprint for CELL files is the use of %BLOCK and %ENDBLOCK to denote data blocks (not case sensitive). >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('Si_uppercase.cell') ...
23
264
84
348
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,606
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
698,699
695,705
set_meta
DRF
702,705
699,705
class DRF(GenericMolFile): file_ext = "drf" def set_meta(self, dataset: DatasetProtocol, overwrite: bool = True, **kwd) -> None: FILL_FUNC_BODY
class DRF(GenericMolFile): file_ext = "drf" def set_meta(self, dataset: DatasetProtocol, overwrite: bool = True, **kwd) -> None: """ Set the number of lines of data in dataset. """ FILL_FUNC_BODY
dataset.metadata.number_of_molecules = count_special_lines('"ligand id"', dataset.get_file_name(), invert=True)
""" Set the number of lines of data in dataset. """ dataset.metadata.number_of_molecules = count_special_lines('"ligand id"', dataset.get_file_name(), invert=True)
6
79
43
122
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,607
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
1155,1156
1118,1234
read_blocks
ExtendedXYZ
1161,1234
1156,1234
@build_sniff_from_prefix class ExtendedXYZ(XYZ): """ Extended XYZ format. Uses specification from https://github.com/libAtoms/extxyz. """ file_ext = "extxyz" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Try to guess if the file is an Extended XYZ file. ...
@build_sniff_from_prefix class ExtendedXYZ(XYZ): """ Extended XYZ format. Uses specification from https://github.com/libAtoms/extxyz. """ file_ext = "extxyz" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Try to guess if the file is an Extended XYZ file. ...
# remove trailing blank lines # blank lines not permitted elsewhere in file except for designated comment lines while not lines[-1].strip(): lines = lines[:-1] blocks = [] while lines: n_atoms = None comment = None atoms = [] ...
""" Parses and returns a list of XYZ structure blocks (aka frames). Raises IndexError, TypeError, ValueError """ # remove trailing blank lines # blank lines not permitted elsewhere in file except for designated comment lines while not lines[-1].strip(): ...
306
469
978
1,447
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,608
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
610,612
531,635
merge
FPS
616,635
612,635
@build_sniff_from_prefix class FPS(GenericMolFile): """ chemfp fingerprint file: http://code.google.com/p/chem-fingerprints/wiki/FPS """ file_ext = "fps" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Try to guess if the file is a FPS file. >>> from galaxy.da...
@build_sniff_from_prefix class FPS(GenericMolFile): """ chemfp fingerprint file: http://code.google.com/p/chem-fingerprints/wiki/FPS """ file_ext = "fps" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Try to guess if the file is a FPS file. >>> from galaxy.da...
if len(split_files) == 1: # For one file only, use base class method (move/copy) return Text.merge(split_files, output_file) if not split_files: raise ValueError(f"No fps files given, {split_files!r}, to merge into {output_file}") with open(output_file, "w") a...
""" Merging fps files requires merging the header manually. We take the header from the first file. """ if len(split_files) == 1: # For one file only, use base class method (move/copy) return Text.merge(split_files, output_file) if not split_files:...
84
968
219
1,187
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,609
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
1521,1522
1513,1556
sniff_prefix
GRO
1533,1546
1522,1546
class GRO(GenericMolFile): """ GROMACS structure format. https://manual.gromacs.org/current/reference-manual/file-formats.html#gro """ file_ext = "gro" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: ...
class GRO(GenericMolFile): """ GROMACS structure format. https://manual.gromacs.org/current/reference-manual/file-formats.html#gro """ file_ext = "gro" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Try to guess if the file is a GRO file. >>> from galaxy....
headers = get_headers(file_prefix, sep="\n", count=300) try: int(headers[1][0]) # the second line should just be the number of atoms except ValueError: return False for line in headers[2:-1]: # skip the first, second and last lines if not re.search( ...
""" Try to guess if the file is a GRO file. >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('5e5z.gro') >>> GRO().sniff_prefix(fname) True >>> fname = get_test_fname('5e5z.pdb') >>> GRO().sniff_prefix(fname) False ...
50
336
198
534
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,610
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
73,74
58,202
set_peek
GenericMolFile
74,84
74,84
class GenericMolFile(Text): """ Abstract class for most of the molecule files. """ MetadataElement( name="number_of_molecules", default=0, desc="Number of molecules", readonly=True, visible=True, optional=True, no_value=0, ) def set_peek(...
class GenericMolFile(Text): """ Abstract class for most of the molecule files. """ MetadataElement( name="number_of_molecules", default=0, desc="Number of molecules", readonly=True, visible=True, optional=True, no_value=0, ) def set_peek(...
if not dataset.dataset.purged: if dataset.metadata.number_of_molecules == 1: dataset.blurb = "1 molecule" else: dataset.blurb = f"{dataset.metadata.number_of_molecules} molecules" dataset.peek = get_file_peek(dataset.get_file_name()) el...
if not dataset.dataset.purged: if dataset.metadata.number_of_molecules == 1: dataset.blurb = "1 molecule" else: dataset.blurb = f"{dataset.metadata.number_of_molecules} molecules" dataset.peek = get_file_peek(dataset.get_file_name()) el...
32
773
133
906
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,611
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
1287,1288
1258,1319
set_peek
InChI
1288,1298
1288,1298
@build_sniff_from_prefix class InChI(Tabular): file_ext = "inchi" column_names = ["InChI"] MetadataElement(name="columns", default=2, desc="Number of columns", readonly=True, visible=False) MetadataElement( name="column_types", default=["str"], param=metadata.ColumnTypesParameter...
@build_sniff_from_prefix class InChI(Tabular): file_ext = "inchi" column_names = ["InChI"] MetadataElement(name="columns", default=2, desc="Number of columns", readonly=True, visible=False) MetadataElement( name="column_types", default=["str"], param=metadata.ColumnTypesParameter...
if not dataset.dataset.purged: if dataset.metadata.number_of_molecules == 1: dataset.blurb = "1 molecule" else: dataset.blurb = f"{dataset.metadata.number_of_molecules} molecules" dataset.peek = get_file_peek(dataset.get_file_name()) el...
if not dataset.dataset.purged: if dataset.metadata.number_of_molecules == 1: dataset.blurb = "1 molecule" else: dataset.blurb = f"{dataset.metadata.number_of_molecules} molecules" dataset.peek = get_file_peek(dataset.get_file_name()) el...
32
520
133
653
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,612
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
335,336
332,342
set_meta
MOL
339,342
336,342
class MOL(GenericMolFile): file_ext = "mol" def set_meta(self, dataset: DatasetProtocol, overwrite: bool = True, **kwd) -> None: FILL_FUNC_BODY
class MOL(GenericMolFile): file_ext = "mol" def set_meta(self, dataset: DatasetProtocol, overwrite: bool = True, **kwd) -> None: """ Set the number molecules, in the case of MOL its always one. """ FILL_FUNC_BODY
dataset.metadata.number_of_molecules = 1
""" Set the number molecules, in the case of MOL its always one. """ dataset.metadata.number_of_molecules = 1
3
84
20
104
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,613
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
477,479
444,531
split
MOL2
482,531
479,531
@build_sniff_from_prefix class MOL2(GenericMolFile): file_ext = "mol2" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Try to guess if the file is a MOL2 file. >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('drugbank_drugs.mol2') ...
@build_sniff_from_prefix class MOL2(GenericMolFile): file_ext = "mol2" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Try to guess if the file is a MOL2 file. >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('drugbank_drugs.mol2') ...
if split_params is None: return None if len(input_datasets) > 1: raise Exception("MOL2-file splitting does not support multiple files") input_files = [ds.get_file_name() for ds in input_datasets] chunk_size = None if split_params["split_mode"] == "number...
""" Split the input files by molecule records. """ if split_params is None: return None if len(input_datasets) > 1: raise Exception("MOL2-file splitting does not support multiple files") input_files = [ds.get_file_name() for ds in input_datasets] ...
138
416
626
1,042
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,614
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
1563,1564
1556,1575
sniff_prefix
Magres
1574,1575
1564,1575
@build_sniff_from_prefix class Magres(AtomicStructFile): """Report on a MAGRES calculation""" file_ext = "magres" ase_format = "magres" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
@build_sniff_from_prefix class Magres(AtomicStructFile): """Report on a MAGRES calculation""" file_ext = "magres" ase_format = "magres" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """Determines whether the file is a MAGRES log >>> from galaxy.datatypes.sniff import get_te...
return file_prefix.startswith("#$magres-abinitio-v")
"""Determines whether the file is a MAGRES log >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('ethanol.magres') >>> Magres().sniff(fname) True >>> fname = get_test_fname('Si.cif') >>> Magres().sniff(fname) False "...
2
191
22
213
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,615
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
662,663
635,695
set_peek
OBFS
664,671
663,671
class OBFS(Binary): """OpenBabel Fastsearch format (fs).""" file_ext = "obfs" composite_type = "basic" MetadataElement( name="base_name", default="OpenBabel Fastsearch Index", readonly=True, visible=True, optional=True, ) def __init__(self, **kwd): ...
class OBFS(Binary): """OpenBabel Fastsearch format (fs).""" file_ext = "obfs" composite_type = "basic" MetadataElement( name="base_name", default="OpenBabel Fastsearch Index", readonly=True, visible=True, optional=True, ) def __init__(self, **kwd): ...
if not dataset.dataset.purged: dataset.peek = "OpenBabel Fastsearch Index" dataset.blurb = "OpenBabel Fastsearch Index" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
"""Set the peek and blurb text.""" if not dataset.dataset.purged: dataset.peek = "OpenBabel Fastsearch Index" dataset.blurb = "OpenBabel Fastsearch Index" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
26
679
80
759
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,616
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
765,766
721,793
set_meta
PDB
769,781
766,781
@build_sniff_from_prefix class PDB(GenericMolFile): """ Protein Databank format. http://www.wwpdb.org/documentation/format33/v3.3.html """ file_ext = "pdb" MetadataElement(name="chain_ids", default=[], desc="Chain IDs", readonly=False, visible=True) def sniff_prefix(self, file_prefix: File...
@build_sniff_from_prefix class PDB(GenericMolFile): """ Protein Databank format. http://www.wwpdb.org/documentation/format33/v3.3.html """ file_ext = "pdb" MetadataElement(name="chain_ids", default=[], desc="Chain IDs", readonly=False, visible=True) def sniff_prefix(self, file_prefix: File...
try: chain_ids = set() with open(dataset.get_file_name()) as fh: for line in fh: if line.startswith("ATOM ") or line.startswith("HETATM"): if line[21] != " ": chain_ids.add(line[21]) data...
""" Find Chain_IDs for metadata. """ try: chain_ids = set() with open(dataset.get_file_name()) as fh: for line in fh: if line.startswith("ATOM ") or line.startswith("HETATM"): if line[21] != " ": ...
36
703
150
853
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,617
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
834,835
793,845
set_peek
PDBQT
835,845
835,845
@build_sniff_from_prefix class PDBQT(GenericMolFile): """ PDBQT Autodock and Autodock Vina format http://autodock.scripps.edu/faqs-help/faq/what-is-the-format-of-a-pdbqt-file """ file_ext = "pdbqt" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Try to guess if the...
@build_sniff_from_prefix class PDBQT(GenericMolFile): """ PDBQT Autodock and Autodock Vina format http://autodock.scripps.edu/faqs-help/faq/what-is-the-format-of-a-pdbqt-file """ file_ext = "pdbqt" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Try to guess if the...
if not dataset.dataset.purged: root_numbers = count_special_lines("^ROOT", dataset.get_file_name()) branch_numbers = count_special_lines("^BRANCH", dataset.get_file_name()) dataset.peek = get_file_peek(dataset.get_file_name()) dataset.blurb = f"{root_numbers} root...
if not dataset.dataset.purged: root_numbers = count_special_lines("^ROOT", dataset.get_file_name()) branch_numbers = count_special_lines("^BRANCH", dataset.get_file_name()) dataset.peek = get_file_peek(dataset.get_file_name()) dataset.blurb = f"{root_numbers} root...
34
449
152
601
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,618
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
712,713
705,721
set_peek
PHAR
713,721
713,721
class PHAR(GenericMolFile): """ Pharmacophore database format from silicos-it. """ file_ext = "phar" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: FILL_FUNC_BODY
class PHAR(GenericMolFile): """ Pharmacophore database format from silicos-it. """ file_ext = "phar" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: FILL_FUNC_BODY
if not dataset.dataset.purged: dataset.peek = get_file_peek(dataset.get_file_name()) dataset.blurb = "pharmacophore" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
if not dataset.dataset.purged: dataset.peek = get_file_peek(dataset.get_file_name()) dataset.blurb = "pharmacophore" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
22
77
88
165
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,619
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
892,893
845,950
sniff_prefix
PQR
903,919
893,919
@build_sniff_from_prefix class PQR(GenericMolFile): """ Protein Databank format. https://apbs-pdb2pqr.readthedocs.io/en/latest/formats/pqr.html """ file_ext = "pqr" MetadataElement(name="chain_ids", default=[], desc="Chain IDs", readonly=False, visible=True) def get_matcher(self) -> re.Pat...
@build_sniff_from_prefix class PQR(GenericMolFile): """ Protein Databank format. https://apbs-pdb2pqr.readthedocs.io/en/latest/formats/pqr.html """ file_ext = "pqr" MetadataElement(name="chain_ids", default=[], desc="Chain IDs", readonly=False, visible=True) def get_matcher(self) -> re.Pat...
prog = self.get_matcher() headers = iter_headers(file_prefix, sep=None, comment_designator="REMARK 5", count=3000) h = a = False for line in headers: section_name = line[0].strip() if section_name == "REMARK": h = True elif section_na...
""" Try to guess if the file is a PQR file. >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('5e5z.pqr') >>> PQR().sniff(fname) True >>> fname = get_test_fname('drugbank_drugs.cml') >>> PQR().sniff(fname) False ...
53
1,167
170
1,337
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,620
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
394,396
342,444
split
SDF
399,444
396,444
@build_sniff_from_prefix class SDF(GenericMolFile): file_ext = "sdf" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Try to guess if the file is a SDF2 file. An SDfile (structure-data file) can contain multiple compounds. Each compound starts with a block in V2000...
@build_sniff_from_prefix class SDF(GenericMolFile): file_ext = "sdf" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Try to guess if the file is a SDF2 file. An SDfile (structure-data file) can contain multiple compounds. Each compound starts with a block in V2000...
if split_params is None: return None if len(input_datasets) > 1: raise Exception("SD-file splitting does not support multiple files") input_files = [ds.get_file_name() for ds in input_datasets] chunk_size = None if split_params["split_mode"] == "number_o...
""" Split the input files by molecule records. """ if split_params is None: return None if len(input_datasets) > 1: raise Exception("SD-file splitting does not support multiple files") input_files = [ds.get_file_name() for ds in input_datasets] ...
129
630
582
1,212
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,621
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
1346,1347
1319,1364
set_meta
SMILES
1350,1352
1347,1352
class SMILES(Tabular): # It is hard or impossible to sniff a SMILES File. We can try to import the # first SMILES and check if it is a molecule, but currently it is not # possible to use external libraries in datatype definition files. # Moreover it seems impossible to include OpenBabel as Python librar...
class SMILES(Tabular): # It is hard or impossible to sniff a SMILES File. We can try to import the # first SMILES and check if it is a molecule, but currently it is not # possible to use external libraries in datatype definition files. # Moreover it seems impossible to include OpenBabel as Python librar...
dataset.metadata.number_of_molecules = self.count_data_lines(dataset)
""" Set the number of lines of data in dataset. """ dataset.metadata.number_of_molecules = self.count_data_lines(dataset)
3
480
27
507
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,622
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
1077,1078
1037,1118
read_blocks
XYZ
1083,1118
1078,1118
@build_sniff_from_prefix class XYZ(AtomicStructFile): """ XYZ format. """ file_ext = "xyz" # ASE recommend always parsing as extended xyz ase_format = "extxyz" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Try to guess if the file is a XYZ file. XYZ ...
@build_sniff_from_prefix class XYZ(AtomicStructFile): """ XYZ format. """ file_ext = "xyz" # ASE recommend always parsing as extended xyz ase_format = "extxyz" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Try to guess if the file is a XYZ file. XYZ ...
# remove trailing blank lines # blank lines not permitted elsewhere in file except for designated comment lines while not lines[-1].strip(): lines = lines[:-1] blocks = [] while lines: n_atoms = None comment = None atoms = [] ...
""" Parses and returns a list of dictionaries representing XYZ structure blocks (aka frames). Raises IndexError, TypeError, ValueError """ # remove trailing blank lines # blank lines not permitted elsewhere in file except for designated comment lines while not li...
121
449
342
791
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,623
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
1237,1238
1234,1246
set_peek
grd
1238,1246
1238,1246
class grd(Text): file_ext = "grd" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: FILL_FUNC_BODY
class grd(Text): file_ext = "grd" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: FILL_FUNC_BODY
if not dataset.dataset.purged: dataset.peek = get_file_peek(dataset.get_file_name()) dataset.blurb = "grids for docking" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
if not dataset.dataset.purged: dataset.peek = get_file_peek(dataset.get_file_name()) dataset.blurb = "grids for docking" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
24
52
88
140
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,624
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/molecules.py
1249,1250
1246,1258
set_peek
grdtgz
1250,1258
1250,1258
class grdtgz(Binary): file_ext = "grd.tgz" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: FILL_FUNC_BODY
class grdtgz(Binary): file_ext = "grd.tgz" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: FILL_FUNC_BODY
if not dataset.dataset.purged: dataset.peek = "binary data" dataset.blurb = "compressed grids for docking" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
if not dataset.dataset.purged: dataset.peek = "binary data" dataset.blurb = "compressed grids for docking" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
26
56
79
135
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes import metadata from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy...
45,625
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/msa.py
98,99
93,117
set_peek
Hmmer
99,106
99,106
@build_sniff_from_prefix class Hmmer(Text): edam_data = "data_1364" edam_format = "format_1370" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: FILL_FUNC_BODY def display_peek(self, dataset: DatasetProtocol) -> str: try: return dataset.peek except Exception: ...
@build_sniff_from_prefix class Hmmer(Text): edam_data = "data_1364" edam_format = "format_1370" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: FILL_FUNC_BODY def display_peek(self, dataset: DatasetProtocol) -> str: try: return dataset.peek except Exception: ...
if not dataset.dataset.purged: dataset.peek = get_file_peek(dataset.get_file_name()) dataset.blurb = "HMMER Database" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disc"
if not dataset.dataset.purged: dataset.peek = get_file_peek(dataset.get_file_name()) dataset.blurb = "HMMER Database" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disc"
23
183
85
268
import abc import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import...
import abc import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import...
45,626
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/msa.py
121,122
117,126
sniff_prefix
Hmmer2
123,126
122,126
class Hmmer2(Hmmer): edam_format = "format_3328" file_ext = "hmm2" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
class Hmmer2(Hmmer): edam_format = "format_3328" file_ext = "hmm2" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """HMMER2 files start with HMMER2.0""" FILL_FUNC_BODY
return file_prefix.startswith("HMMER2.0")
"""HMMER2 files start with HMMER2.0""" return file_prefix.startswith("HMMER2.0")
2
86
23
109
import abc import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import...
import abc import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import...
45,627
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/msa.py
130,131
126,135
sniff_prefix
Hmmer3
132,135
131,135
class Hmmer3(Hmmer): edam_format = "format_3329" file_ext = "hmm3" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
class Hmmer3(Hmmer): edam_format = "format_3329" file_ext = "hmm3" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """HMMER3 files start with HMMER3/f""" FILL_FUNC_BODY
return file_prefix.startswith("HMMER3/f")
"""HMMER3 files start with HMMER3/f""" return file_prefix.startswith("HMMER3/f")
2
86
23
109
import abc import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import...
import abc import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import...
45,628
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/msa.py
141,142
135,169
set_peek
HmmerPress
143,150
142,150
class HmmerPress(Binary): """Class for hmmpress database files.""" file_ext = "hmmpress" composite_type = "basic" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: FILL_FUNC_BODY def display_peek(self, dataset: DatasetProtocol) -> str: """Create HTML content, used for displaying ...
class HmmerPress(Binary): """Class for hmmpress database files.""" file_ext = "hmmpress" composite_type = "basic" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: """Set the peek and blurb text.""" FILL_FUNC_BODY def display_peek(self, dataset: DatasetProtocol) -> str: "...
if not dataset.dataset.purged: dataset.peek = "HMMER Binary database" dataset.blurb = "HMMER Binary database" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
"""Set the peek and blurb text.""" if not dataset.dataset.purged: dataset.peek = "HMMER Binary database" dataset.blurb = "HMMER Binary database" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
26
315
80
395
import abc import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import...
import abc import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import...
45,629
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/msa.py
82,83
34,93
set_meta
InfernalCM
86,93
83,93
@build_sniff_from_prefix class InfernalCM(Text): file_ext = "cm" MetadataElement( name="number_of_models", default=0, desc="Number of covariance models", readonly=True, visible=True, optional=True, no_value=0, ) MetadataElement( name="cm_...
@build_sniff_from_prefix class InfernalCM(Text): file_ext = "cm" MetadataElement( name="number_of_models", default=0, desc="Number of covariance models", readonly=True, visible=True, optional=True, no_value=0, ) MetadataElement( name="cm_...
dataset.metadata.number_of_models = generic_util.count_special_lines("^INFERNAL", dataset.get_file_name()) with open(dataset.get_file_name()) as f: first_line = f.readline() if first_line.startswith("INFERNAL"): dataset.metadata.cm_version = (first_line.split()[0]...
""" Set the number of models and the version of CM file in dataset. """ dataset.metadata.number_of_models = generic_util.count_special_lines("^INFERNAL", dataset.get_file_name()) with open(dataset.get_file_name()) as f: first_line = f.readline() if first_l...
17
525
119
644
import abc import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import...
import abc import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import...
45,630
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/msa.py
286,287
261,295
sniff_prefix
MauveXmfa
287,289
287,289
@build_sniff_from_prefix class MauveXmfa(Text): file_ext = "xmfa" MetadataElement( name="number_of_models", default=0, desc="Number of alignmened sequences", readonly=True, visible=True, optional=True, no_value=0, ) def set_peek(self, dataset: Da...
@build_sniff_from_prefix class MauveXmfa(Text): file_ext = "xmfa" MetadataElement( name="number_of_models", default=0, desc="Number of alignmened sequences", readonly=True, visible=True, optional=True, no_value=0, ) def set_peek(self, dataset: Da...
return file_prefix.startswith("#FormatVersion Mauve1")
return file_prefix.startswith("#FormatVersion Mauve1")
3
352
21
373
import abc import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import...
import abc import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import...
45,631
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/msa.py
185,186
169,261
set_peek
Stockholm_1_0
186,196
186,196
@build_sniff_from_prefix class Stockholm_1_0(Text): edam_data = "data_0863" edam_format = "format_1961" file_ext = "stockholm" MetadataElement( name="number_of_models", default=0, desc="Number of multiple alignments", readonly=True, visible=True, optional...
@build_sniff_from_prefix class Stockholm_1_0(Text): edam_data = "data_0863" edam_format = "format_1961" file_ext = "stockholm" MetadataElement( name="number_of_models", default=0, desc="Number of multiple alignments", readonly=True, visible=True, optional...
if not dataset.dataset.purged: if dataset.metadata.number_of_models == 1: dataset.blurb = "1 alignment" else: dataset.blurb = f"{dataset.metadata.number_of_models} alignments" dataset.peek = get_file_peek(dataset.get_file_name()) else: ...
if not dataset.dataset.purged: if dataset.metadata.number_of_models == 1: dataset.blurb = "1 alignment" else: dataset.blurb = f"{dataset.metadata.number_of_models} alignments" dataset.peek = get_file_peek(dataset.get_file_name()) else: ...
32
941
128
1,069
import abc import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import...
import abc import logging import os import re from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes.binary import Binary from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import...
45,632
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/neo4j.py
26,27
19,65
generate_primary_file
Neo4j
31,44
27,44
class Neo4j(Html): """ base class to use for neostore datatypes derived from html - composite datatype elements stored in extra files path """ def generate_primary_file(self, dataset: HasExtraFilesAndMetadata) -> str: FILL_FUNC_BODY def get_mime(self) -> str: """Returns the mime type...
class Neo4j(Html): """ base class to use for neostore datatypes derived from html - composite datatype elements stored in extra files path """ def generate_primary_file(self, dataset: HasExtraFilesAndMetadata) -> str: """ This is called only at upload to write the html file ...
# self.regenerate_primary_file(dataset) rval = [ f"<html><head><title>Files for Composite Dataset ({self.file_ext})</title></head><p/>\ This composite dataset is composed of the following files:<p/><ul>" ] for composite_name, composite_file in self.get_composite_f...
""" This is called only at upload to write the html file cannot rename the datasets here - they come with the default unfortunately """ # self.regenerate_primary_file(dataset) rval = [ f"<html><head><title>Files for Composite Dataset ({self.file_ext})</title><...
39
331
210
541
""" Neo4j Composite Dataset """ import logging from galaxy.datatypes.data import Data from galaxy.datatypes.images import Html from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import ( DatasetProtocol, HasExtraFilesAndMetadata, ) gal_Log = logging.getLogger(__name__) verb...
""" Neo4j Composite Dataset """ import logging from galaxy.datatypes.data import Data from galaxy.datatypes.images import Html from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import ( DatasetProtocol, HasExtraFilesAndMetadata, ) gal_Log = logging.getLogger(__name__) verb...
45,633
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/ngsindex.py
66,67
19,81
set_peek
BowtieIndex
67,74
67,74
class BowtieIndex(Html): """ base class for BowtieIndex is subclassed by BowtieColorIndex and BowtieBaseIndex """ MetadataElement( name="base_name", desc="base name for this index set", default="galaxy_generated_bowtie_index", set_in_upload=True, readonly=Tru...
class BowtieIndex(Html): """ base class for BowtieIndex is subclassed by BowtieColorIndex and BowtieBaseIndex """ MetadataElement( name="base_name", desc="base name for this index set", default="galaxy_generated_bowtie_index", set_in_upload=True, readonly=Tru...
if not dataset.dataset.purged: dataset.peek = f"Bowtie index file ({dataset.metadata.sequence_space})" dataset.blurb = f"{dataset.metadata.sequence_space} space" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
if not dataset.dataset.purged: dataset.peek = f"Bowtie index file ({dataset.metadata.sequence_space})" dataset.blurb = f"{dataset.metadata.sequence_space} space" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
26
581
96
677
""" NGS indexes """ import logging import os from galaxy.datatypes.protocols import ( DatasetProtocol, HasExtraFilesAndMetadata, ) from galaxy.util import UNKNOWN from .metadata import MetadataElement from .text import Html log = logging.getLogger(__name__) class BowtieIndex(Html): """ base class f...
""" NGS indexes """ import logging import os from galaxy.datatypes.protocols import ( DatasetProtocol, HasExtraFilesAndMetadata, ) from galaxy.util import UNKNOWN from .metadata import MetadataElement from .text import Html log = logging.getLogger(__name__) class BowtieIndex(Html): """ base class f...
45,634
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/phylip.py
95,96
30,167
sniff_relaxed_interleaved
Phylip
96,127
96,127
@build_sniff_from_prefix class Phylip(Text): """Phylip format stores a multiple sequence alignment""" edam_data = "data_0863" edam_format = "format_1997" file_ext = "phylip" MetadataElement( name="sequences", default=0, desc="Number of sequences", readonly=True, visible=False, optional=Tru...
@build_sniff_from_prefix class Phylip(Text): """Phylip format stores a multiple sequence alignment""" edam_data = "data_0863" edam_format = "format_1997" file_ext = "phylip" MetadataElement( name="sequences", default=0, desc="Number of sequences", readonly=True, visible=False, optional=Tru...
found_seq_length = None for _ in range(nb_seq): line = alignment_prefix.readline() if not line: # Not enough lines, either the prefix is too short or this is not PHYLIP return False line = line.rstrip("\n") # In the relaxed ...
found_seq_length = None for _ in range(nb_seq): line = alignment_prefix.readline() if not line: # Not enough lines, either the prefix is too short or this is not PHYLIP return False line = line.rstrip("\n") # In the relaxed ...
161
1,284
374
1,658
""" Created on January. 05, 2018 @authors: Kenzo-Hugo Hillion and Fabien Mareuil, Institut Pasteur, Paris @contacts: kehillio@pasteur.fr and fabien.mareuil@pasteur.fr @project: galaxy @githuborganization: C3BI Phylip datatype sniffer """ from typing import TYPE_CHECKING from galaxy import util from galaxy.datatypes....
""" Created on January. 05, 2018 @authors: Kenzo-Hugo Hillion and Fabien Mareuil, Institut Pasteur, Paris @contacts: kehillio@pasteur.fr and fabien.mareuil@pasteur.fr @project: galaxy @githuborganization: C3BI Phylip datatype sniffer """ from typing import TYPE_CHECKING from galaxy import util from galaxy.datatypes....
45,635
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/plant_tribes.py
125,126
86,151
set_peek
PlantTribesKsComponents
126,136
126,136
class PlantTribesKsComponents(Tabular): file_ext = "ptkscmp" MetadataElement( name="number_comp", default=0, desc="Number of significant components in the Ks distribution", readonly=True, visible=True, no_value=0, ) def display_peek(self, dataset: Dataset...
class PlantTribesKsComponents(Tabular): file_ext = "ptkscmp" MetadataElement( name="number_comp", default=0, desc="Number of significant components in the Ks distribution", readonly=True, visible=True, no_value=0, ) def display_peek(self, dataset: Dataset...
if not dataset.dataset.purged: dataset.peek = get_file_peek(dataset.get_file_name()) if dataset.metadata.number_comp == 1: dataset.blurb = "1 significant component" else: dataset.blurb = f"{dataset.metadata.number_comp} significant components" ...
if not dataset.dataset.purged: dataset.peek = get_file_peek(dataset.get_file_name()) if dataset.metadata.number_comp == 1: dataset.blurb = "1 significant component" else: dataset.blurb = f"{dataset.metadata.number_comp} significant components" ...
34
613
125
738
import logging import re from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, get_headers, ) from galaxy.datat...
import logging import re from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, get_headers, ) from galaxy.datat...
45,636
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/plant_tribes.py
39,40
21,86
sniff_prefix
Smat
62,86
40,86
@build_sniff_from_prefix class Smat(Text): file_ext = "smat" def display_peek(self, dataset: DatasetProtocol) -> str: try: return dataset.peek except Exception: return f"ESTScan scores matrices ({nice_size(dataset.get_size())})" def set_peek(self, dataset: DatasetPr...
@build_sniff_from_prefix class Smat(Text): file_ext = "smat" def display_peek(self, dataset: DatasetProtocol) -> str: try: return dataset.peek except Exception: return f"ESTScan scores matrices ({nice_size(dataset.get_size())})" def set_peek(self, dataset: DatasetPr...
line_no = 0 fh = file_prefix.string_io() for line in fh: line_no += 1 if line_no > 10000: return True if line_no == 1 and not line.startswith("FORMAT"): # The first line is always the start of a format section. r...
""" The use of ESTScan implies the creation of scores matrices which reflect the codons preferences in the studied organisms. The ESTScan package includes scripts for generating these files. The output of these scripts consists of the matrices, one for each isochor, and...
97
475
245
720
import logging import re from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, get_headers, ) from galaxy.datat...
import logging import re from galaxy.datatypes.data import ( get_file_peek, Text, ) from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, get_headers, ) from galaxy.datat...
45,637
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/protocols.py
88,88
56,91
attach_implicitly_converted_dataset
DatasetProtocol
88,89
88,89
class DatasetProtocol( HasCreatingJob, HasExt, HasExtraFilesPath, HasFileName, HasId, HasInfo, HasMetadata, HasName, Protocol, ): blurb: str dataset: Any dbkey: Any extension: str peek: Any state: Any states: Any @property def datatype(self): ... ...
class DatasetProtocol( HasCreatingJob, HasExt, HasExtraFilesPath, HasFileName, HasId, HasInfo, HasMetadata, HasName, Protocol, ): blurb: str dataset: Any dbkey: Any extension: str peek: Any state: Any states: Any @property def datatype(self): ... ...
def attach_implicitly_converted_dataset(self, session, new_dataset, target_ext: str) -> None: ...
def attach_implicitly_converted_dataset(self, session, new_dataset, target_ext: str) -> None: ...
9
207
34
241
""" Location of protocols used in datatypes """ from typing import Any from typing_extensions import Protocol class HasClearAssociatedFiles(Protocol): def clear_associated_files(self, metadata_safe: bool = False, purge: bool = False) -> None: ... class HasCreatingJob(Protocol): @property def creating_...
""" Location of protocols used in datatypes """ from typing import Any from typing_extensions import Protocol class HasClearAssociatedFiles(Protocol): def clear_associated_files(self, metadata_safe: bool = False, purge: bool = False) -> None: ... class HasCreatingJob(Protocol): @property def creating_...
45,638
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/protocols.py
11,11
10,14
clear_associated_files
HasClearAssociatedFiles
11,12
11,12
class HasClearAssociatedFiles(Protocol): FILL_FUNC_BODY
class HasClearAssociatedFiles(Protocol): FILL_FUNC_BODY
def clear_associated_files(self, metadata_safe: bool = False, purge: bool = False) -> None: ...
def clear_associated_files(self, metadata_safe: bool = False, purge: bool = False) -> None: ...
13
22
32
54
""" Location of protocols used in datatypes """ from typing import Any from typing_extensions import Protocol class HasClearAssociatedFiles(Protocol): FILL_FUNC_BODY class HasCreatingJob(Protocol): @property def creating_job(self): ... class HasExt(Protocol): @property def ext(self): ... class ...
""" Location of protocols used in datatypes """ from typing import Any from typing_extensions import Protocol class HasClearAssociatedFiles(Protocol): FILL_FUNC_BODY class HasCreatingJob(Protocol): @property def creating_job(self): ... class HasExt(Protocol): @property def ext(self): ... class ...
45,639
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/protocols.py
15,16
14,19
creating_job
HasCreatingJob
16,17
16,17
class HasCreatingJob(Protocol): @property FILL_FUNC_BODY
class HasCreatingJob(Protocol): @property FILL_FUNC_BODY
def creating_job(self): ...
def creating_job(self): ...
3
25
11
36
""" Location of protocols used in datatypes """ from typing import Any from typing_extensions import Protocol class HasClearAssociatedFiles(Protocol): def clear_associated_files(self, metadata_safe: bool = False, purge: bool = False) -> None: ... class HasCreatingJob(Protocol): @property FILL_FUNC_BODY c...
""" Location of protocols used in datatypes """ from typing import Any from typing_extensions import Protocol class HasClearAssociatedFiles(Protocol): def clear_associated_files(self, metadata_safe: bool = False, purge: bool = False) -> None: ... class HasCreatingJob(Protocol): @property FILL_FUNC_BODY c...
45,640
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/protocols.py
20,21
19,24
ext
HasExt
21,22
21,22
class HasExt(Protocol): @property FILL_FUNC_BODY
class HasExt(Protocol): @property FILL_FUNC_BODY
def ext(self): ...
def ext(self): ...
3
23
9
32
""" Location of protocols used in datatypes """ from typing import Any from typing_extensions import Protocol class HasClearAssociatedFiles(Protocol): def clear_associated_files(self, metadata_safe: bool = False, purge: bool = False) -> None: ... class HasCreatingJob(Protocol): @property def creating_...
""" Location of protocols used in datatypes """ from typing import Any from typing_extensions import Protocol class HasClearAssociatedFiles(Protocol): def clear_associated_files(self, metadata_safe: bool = False, purge: bool = False) -> None: ... class HasCreatingJob(Protocol): @property def creating_...
45,641
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/protocols.py
25,26
24,29
extra_files_path
HasExtraFilesPath
26,27
26,27
class HasExtraFilesPath(Protocol): @property FILL_FUNC_BODY
class HasExtraFilesPath(Protocol): @property FILL_FUNC_BODY
def extra_files_path(self): ...
def extra_files_path(self): ...
3
25
13
38
""" Location of protocols used in datatypes """ from typing import Any from typing_extensions import Protocol class HasClearAssociatedFiles(Protocol): def clear_associated_files(self, metadata_safe: bool = False, purge: bool = False) -> None: ... class HasCreatingJob(Protocol): @property def creating_...
""" Location of protocols used in datatypes """ from typing import Any from typing_extensions import Protocol class HasClearAssociatedFiles(Protocol): def clear_associated_files(self, metadata_safe: bool = False, purge: bool = False) -> None: ... class HasCreatingJob(Protocol): @property def creating_...
45,642
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/protocols.py
30,30
29,33
get_file_name
HasFileName
30,31
30,31
class HasFileName(Protocol): FILL_FUNC_BODY
class HasFileName(Protocol): FILL_FUNC_BODY
def get_file_name(self, sync_cache=True) -> str: ...
def get_file_name(self, sync_cache=True) -> str: ...
6
19
23
42
""" Location of protocols used in datatypes """ from typing import Any from typing_extensions import Protocol class HasClearAssociatedFiles(Protocol): def clear_associated_files(self, metadata_safe: bool = False, purge: bool = False) -> None: ... class HasCreatingJob(Protocol): @property def creating_...
""" Location of protocols used in datatypes """ from typing import Any from typing_extensions import Protocol class HasClearAssociatedFiles(Protocol): def clear_associated_files(self, metadata_safe: bool = False, purge: bool = False) -> None: ... class HasCreatingJob(Protocol): @property def creating_...
45,644
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/qiime2.py
87,88
84,92
sniff
QIIME2Artifact
88,92
88,92
class QIIME2Artifact(_QIIME2ResultBase): file_ext = "qza" def sniff(self, filename: str) -> bool: FILL_FUNC_BODY
class QIIME2Artifact(_QIIME2ResultBase): file_ext = "qza" def sniff(self, filename: str) -> bool: FILL_FUNC_BODY
metadata = self._sniff(filename) return bool(metadata) and metadata["semantic_type"] != "Visualization" # type: ignore[index]
metadata = self._sniff(filename) return bool(metadata) and metadata["semantic_type"] != "Visualization" # type: ignore[index]
12
53
46
99
import ast import html import io import uuid as _uuid import zipfile from typing import ( Dict, List, Optional, ) import yaml from galaxy.datatypes.binary import CompressedZipArchive from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import ( DatasetProtocol, Has...
import ast import html import io import uuid as _uuid import zipfile from typing import ( Dict, List, Optional, ) import yaml from galaxy.datatypes.binary import CompressedZipArchive from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import ( DatasetProtocol, Has...
45,645
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/qiime2.py
122,123
100,169
set_meta
QIIME2Metadata
127,156
123,156
@build_sniff_from_prefix class QIIME2Metadata(Tabular): """ QIIME 2 supports overriding the type of a column to Categorical when a specific directive `#q2:types` is present under the ID row. Galaxy already understands column types quite well, however we sometimes want to override its inferred type....
@build_sniff_from_prefix class QIIME2Metadata(Tabular): """ QIIME 2 supports overriding the type of a column to Categorical when a specific directive `#q2:types` is present under the ID row. Galaxy already understands column types quite well, however we sometimes want to override its inferred type....
super().set_meta(dataset, overwrite=overwrite, **kwd) if dataset.has_data(): with open(dataset.get_file_name()) as dataset_fh: line = None for line, _ in zip(dataset_fh, range(self._search_lines)): if line.startswith(self._TYPES_DIRECTIVE)...
""" Let Galaxy's Tabular format handle most of this. We will just jump in at the last minute to (potentially) override some column types. """ super().set_meta(dataset, overwrite=overwrite, **kwd) if dataset.has_data(): with open(dataset.get_file_name()) as da...
96
399
383
782
import ast import html import io import uuid as _uuid import zipfile from typing import ( Dict, List, Optional, ) import yaml from galaxy.datatypes.binary import CompressedZipArchive from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import ( DatasetProtocol, Has...
import ast import html import io import uuid as _uuid import zipfile from typing import ( Dict, List, Optional, ) import yaml from galaxy.datatypes.binary import CompressedZipArchive from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import ( DatasetProtocol, Has...
45,646
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/qiime2.py
95,96
92,100
sniff
QIIME2Visualization
96,100
96,100
class QIIME2Visualization(_QIIME2ResultBase): file_ext = "qzv" def sniff(self, filename: str) -> bool: FILL_FUNC_BODY
class QIIME2Visualization(_QIIME2ResultBase): file_ext = "qzv" def sniff(self, filename: str) -> bool: FILL_FUNC_BODY
metadata = self._sniff(filename) return bool(metadata) and metadata["semantic_type"] == "Visualization" # type: ignore[index]
metadata = self._sniff(filename) return bool(metadata) and metadata["semantic_type"] == "Visualization" # type: ignore[index]
12
54
45
99
import ast import html import io import uuid as _uuid import zipfile from typing import ( Dict, List, Optional, ) import yaml from galaxy.datatypes.binary import CompressedZipArchive from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import ( DatasetProtocol, Has...
import ast import html import io import uuid as _uuid import zipfile from typing import ( Dict, List, Optional, ) import yaml from galaxy.datatypes.binary import CompressedZipArchive from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import ( DatasetProtocol, Has...
45,647
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/qiime2.py
211,212
192,234
visit_Name
_PredicateRemover
212,214
212,214
class _PredicateRemover(ast.NodeVisitor): binops = { ast.Add: " + ", ast.Sub: " - ", ast.Mult: " * ", ast.Div: " / ", ast.FloorDiv: " // ", ast.Pow: " ** ", ast.LShift: " << ", ast.RShift: " >> ", ast.BitOr: " | ", ast.BitXor: " ^ ", ...
class _PredicateRemover(ast.NodeVisitor): binops = { ast.Add: " + ", ast.Sub: " - ", ast.Mult: " * ", ast.Div: " / ", ast.FloorDiv: " // ", ast.Pow: " ** ", ast.LShift: " << ", ast.RShift: " >> ", ast.BitOr: " | ", ast.BitXor: " ^ ", ...
self.expression += node.id
self.expression += node.id
3
362
12
374
import ast import html import io import uuid as _uuid import zipfile from typing import ( Dict, List, Optional, ) import yaml from galaxy.datatypes.binary import CompressedZipArchive from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import ( DatasetProtocol, Has...
import ast import html import io import uuid as _uuid import zipfile from typing import ( Dict, List, Optional, ) import yaml from galaxy.datatypes.binary import CompressedZipArchive from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import ( DatasetProtocol, Has...
45,648
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/qiime2.py
66,67
27,84
_peek
_QIIME2ResultBase
67,74
67,74
class _QIIME2ResultBase(CompressedZipArchive): """Base class for QIIME2Artifact and QIIME2Visualization""" MetadataElement(name="semantic_type", readonly=True) MetadataElement(name="semantic_type_simple", readonly=True, visible=False) MetadataElement(name="uuid", readonly=True) MetadataElement(name...
class _QIIME2ResultBase(CompressedZipArchive): """Base class for QIIME2Artifact and QIIME2Visualization""" MetadataElement(name="semantic_type", readonly=True) MetadataElement(name="semantic_type_simple", readonly=True, visible=False) MetadataElement(name="uuid", readonly=True) MetadataElement(name...
peek = [("Type", dataset.metadata.semantic_type), ("UUID", dataset.metadata.uuid)] if not simple: if dataset.metadata.semantic_type != "Visualization": peek.append(("Format", dataset.metadata.format)) peek.append(("Version", dataset.metadata.version)) retu...
peek = [("Type", dataset.metadata.semantic_type), ("UUID", dataset.metadata.uuid)] if not simple: if dataset.metadata.semantic_type != "Visualization": peek.append(("Format", dataset.metadata.format)) peek.append(("Version", dataset.metadata.version)) retu...
19
636
95
731
import ast import html import io import uuid as _uuid import zipfile from typing import ( Dict, List, Optional, ) import yaml from galaxy.datatypes.binary import CompressedZipArchive from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import ( DatasetProtocol, Has...
import ast import html import io import uuid as _uuid import zipfile from typing import ( Dict, List, Optional, ) import yaml from galaxy.datatypes.binary import CompressedZipArchive from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import ( DatasetProtocol, Has...
45,649
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/qualityscore.py
86,87
77,114
sniff_prefix
QualityScore454
96,114
87,114
@build_sniff_from_prefix class QualityScore454(QualityScore): """ until we know more about quality score formats """ edam_format = "format_3611" file_ext = "qual454" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
@build_sniff_from_prefix class QualityScore454(QualityScore): """ until we know more about quality score formats """ edam_format = "format_3611" file_ext = "qual454" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ >>> from galaxy.datatypes.sniff import get_test_fna...
fh = file_prefix.string_io() for line in fh: line = line.strip() if line and not line.startswith("#"): # first non-empty non-comment line if line.startswith(">"): line = fh.readline().strip() if line == "" or line.startswit...
""" >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname( 'sequence.fasta' ) >>> QualityScore454().sniff( fname ) False >>> fname = get_test_fname( 'sequence.qual454' ) >>> QualityScore454().sniff( fname ) True """ ...
59
201
176
377
""" Qualityscore class """ import logging from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, ) from . import data log = logging.getLogger(__name__) class QualityScore(data.Text): """ until we know more about quality score...
""" Qualityscore class """ import logging from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, ) from . import data log = logging.getLogger(__name__) class QualityScore(data.Text): """ until we know more about quality score...
45,650
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/qualityscore.py
36,37
27,77
sniff_prefix
QualityScoreSOLiD
46,70
37,70
@build_sniff_from_prefix class QualityScoreSOLiD(QualityScore): """ until we know more about quality score formats """ edam_format = "format_3610" file_ext = "qualsolid" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY def set_meta(self, dataset: DatasetProtocol, over...
@build_sniff_from_prefix class QualityScoreSOLiD(QualityScore): """ until we know more about quality score formats """ edam_format = "format_3610" file_ext = "qualsolid" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ >>> from galaxy.datatypes.sniff import get_test...
fh = file_prefix.string_io() readlen = None goodblock = 0 for line in fh: line = line.strip() if not line.startswith("#"): # first non-empty non-comment line if line.startswith(">"): line = fh.readline().strip() ...
""" >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname( 'sequence.fasta' ) >>> QualityScoreSOLiD().sniff( fname ) False >>> fname = get_test_fname( 'sequence.qualsolid' ) >>> QualityScoreSOLiD().sniff( fname ) True """...
82
306
237
543
""" Qualityscore class """ import logging from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, ) from . import data log = logging.getLogger(__name__) class QualityScore(data.Text): """ until we know more about quality score...
""" Qualityscore class """ import logging from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, ) from . import data log = logging.getLogger(__name__) class QualityScore(data.Text): """ until we know more about quality score...
45,651
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/spaln.py
117,128
27,190
display_data
_SpalnDb
132,169
128,169
class _SpalnDb(Data): composite_type = "auto_primary_file" MetadataElement( name="spalndb_name", default="spalndb", desc="DB name", readonly=True, visible=True, set_in_upload=True, ) def __init__(self, **kwd): super().__init__(**kwd) self...
class _SpalnDb(Data): composite_type = "auto_primary_file" MetadataElement( name="spalndb_name", default="spalndb", desc="DB name", readonly=True, visible=True, set_in_upload=True, ) def __init__(self, **kwd): super().__init__(**kwd) self...
headers = kwd.pop("headers", {}) if not preview: return super().display_data( trans, dataset=dataset, preview=preview, filename=filename, to_ext=to_ext, offset=offset, ck_size=ck_s...
""" If preview is `True` allows us to format the data shown in the central pane via the "eye" icon. If preview is `False` triggers download. """ headers = kwd.pop("headers", {}) if not preview: return super().display_data( trans, ...
115
1,484
396
1,880
""" spaln Composite Dataset """ import logging import os.path from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes.data import Data from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import ( DatasetHasHidProtocol, DatasetProtocol, ...
""" spaln Composite Dataset """ import logging import os.path from typing import ( Callable, Dict, List, Optional, ) from galaxy.datatypes.data import Data from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import ( DatasetHasHidProtocol, DatasetProtocol, ...
45,652
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/speech.py
117,118
45,139
sniff
BPF
118,139
118,139
class BPF(Text): """Munich BPF annotation format https://www.phonetik.uni-muenchen.de/Bas/BasFormatseng.html#Partitur >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('1_1119_2_22_001.par') >>> BPF().sniff(fname) True >>> fname = get_test_fname('1_1119_2_22_0...
class BPF(Text): """Munich BPF annotation format https://www.phonetik.uni-muenchen.de/Bas/BasFormatseng.html#Partitur >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('1_1119_2_22_001.par') >>> BPF().sniff(fname) True >>> fname = get_test_fname('1_1119_2_22_0...
# We loop over 30 as there are 9 mandatory headers (the last should be # `LBD:`), while there are 21 optional headers that can be # interspersed. seen_headers = [line[0] for line in get_headers(filename, sep=":", count=40)] # We cut everything after LBD, where the headers end an...
# We loop over 30 as there are 9 mandatory headers (the last should be # `LBD:`), while there are 21 optional headers that can be # interspersed. seen_headers = [line[0] for line in get_headers(filename, sep=":", count=40)] # We cut everything after LBD, where the headers end an...
120
669
260
929
from galaxy.datatypes.data import Text from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import get_headers class TextGrid(Text): """Praat Textgrid file for speech annotations >>> from galaxy.da...
from galaxy.datatypes.data import Text from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import get_headers class TextGrid(Text): """Praat Textgrid file for speech annotations >>> from galaxy.da...
45,653
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/speech.py
39,40
10,45
sniff
TextGrid
40,45
40,45
class TextGrid(Text): """Praat Textgrid file for speech annotations >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('1_1119_2_22_001.textgrid') >>> TextGrid().sniff(fname) True >>> fname = get_test_fname('drugbank_drugs.cml') >>> TextGrid().sniff(fname) ...
class TextGrid(Text): """Praat Textgrid file for speech annotations >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('1_1119_2_22_001.textgrid') >>> TextGrid().sniff(fname) True >>> fname = get_test_fname('drugbank_drugs.cml') >>> TextGrid().sniff(fname) ...
with open(filename) as fd: text = fd.read(len(self.header)) return text == self.header
with open(filename) as fd: text = fd.read(len(self.header)) return text == self.header
11
273
41
314
from galaxy.datatypes.data import Text from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import get_headers class TextGrid(Text): """Praat Textgrid file for speech annotations >>> from galaxy.da...
from galaxy.datatypes.data import Text from galaxy.datatypes.metadata import ( ListParameter, MetadataElement, ) from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import get_headers class TextGrid(Text): """Praat Textgrid file for speech annotations >>> from galaxy.da...
45,654
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
702,703
651,756
set_meta
Arff
710,756
703,756
@build_sniff_from_prefix class Arff(Text): """ An ARFF (Attribute-Relation File Format) file is an ASCII text file that describes a list of instances sharing a set of attributes. http://weka.wikispaces.com/ARFF """ edam_format = "format_3581" file_ext = "arff" MetadataElement( name...
@build_sniff_from_prefix class Arff(Text): """ An ARFF (Attribute-Relation File Format) file is an ASCII text file that describes a list of instances sharing a set of attributes. http://weka.wikispaces.com/ARFF """ edam_format = "format_3581" file_ext = "arff" MetadataElement( name...
comment_lines = column_count = 0 if dataset.has_data(): first_real_line = False data_block = False with open(dataset.get_file_name()) as handle: for line in handle: line = line.strip() if not line: ...
""" Trying to count the comment lines and the number of columns included. A typical ARFF data block looks like this: @DATA 5.1,3.5,1.4,0.2,Iris-setosa 4.9,3.0,1.4,0.2,Iris-setosa """ comment_lines = column_count = 0 if dataset.has_data(): ...
149
696
471
1,167
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,655
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
1137,1138
1131,1145
sniff_prefix
BCSLmodel
1141,1145
1138,1145
@build_sniff_from_prefix class BCSLmodel(Text): """BioChemical Space Language model file""" file_ext = "bcsl.model" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
@build_sniff_from_prefix class BCSLmodel(Text): """BioChemical Space Language model file""" file_ext = "bcsl.model" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Determines whether the file is in .bcsl.model format """ FILL_FUNC_BODY
reg = r"^#! rules|^#! inits|^#! definitions" return re.search(reg, file_prefix.contents_header, re.MULTILINE) is not None
""" Determines whether the file is in .bcsl.model format """ reg = r"^#! rules|^#! inits|^#! definitions" return re.search(reg, file_prefix.contents_header, re.MULTILINE) is not None
13
97
53
150
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,656
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
1160,1161
1145,1178
set_peek
BCSLts
1161,1170
1161,1170
@build_sniff_from_prefix class BCSLts(Json): """BioChemical Space Language transition system file""" file_ext = "bcsl.ts" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Determines whether the file is in .bcsl.ts format """ is_bcsl_ts = False if self._l...
@build_sniff_from_prefix class BCSLts(Json): """BioChemical Space Language transition system file""" file_ext = "bcsl.ts" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Determines whether the file is in .bcsl.ts format """ is_bcsl_ts = False if self._l...
if not dataset.dataset.purged: lines = "States: {}\nTransitions: {}\nUnique agents: {}\nInitial state: {}" ts = json.load(open(dataset.get_file_name())) dataset.peek = lines.format(len(ts["nodes"]), len(ts["edges"]), len(ts["ordering"]), ts["initial"]) dataset.blu...
if not dataset.dataset.purged: lines = "States: {}\nTransitions: {}\nUnique agents: {}\nInitial state: {}" ts = json.load(open(dataset.get_file_name())) dataset.peek = lines.format(len(ts["nodes"]), len(ts["edges"]), len(ts["ordering"]), ts["initial"]) dataset.blu...
37
282
155
437
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,657
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
409,410
268,483
_looks_like_biom
Biom1
415,435
410,435
@build_sniff_from_prefix class Biom1(Json): """ BIOM version 1.0 file format description http://biom-format.org/documentation/format_versions/biom-1.0.html """ file_ext = "biom1" edam_format = "format_3746" MetadataElement( name="table_rows", default=[], desc="table...
@build_sniff_from_prefix class Biom1(Json): """ BIOM version 1.0 file format description http://biom-format.org/documentation/format_versions/biom-1.0.html """ file_ext = "biom1" edam_format = "format_3746" MetadataElement( name="table_rows", default=[], desc="table...
is_biom = False segment_size = int(load_size / 2) try: with open(file_prefix.filename) as fh: prev_str = "" segment_str = fh.read(segment_size) if segment_str.strip().startswith("{"): while segment_str: ...
""" @param filepath: [str] The path to the evaluated file. @param load_size: [int] The size of the file block load in RAM (in bytes). """ is_biom = False segment_size = int(load_size / 2) try: with open(file_prefix.filename) a...
56
1,657
220
1,877
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,658
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
1240,1241
1234,1261
sniff_prefix
CTLresult
1244,1247
1241,1247
@build_sniff_from_prefix class CTLresult(Text): """CTL model checking result""" file_ext = "ctl.result" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: if not dataset.dataset.purged: with open(datas...
@build_sniff_from_prefix class CTLresult(Text): """CTL model checking result""" file_ext = "ctl.result" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Determines whether the file is in .ctl.result format """ FILL_FUNC_BODY def set_peek(self, dataset: DatasetProtoco...
keywords = ["Result:", "Number of satisfying states:"] return all(keyword in file_prefix.contents_header for keyword in keywords)
""" Determines whether the file is in .ctl.result format """ keywords = ["Result:", "Number of satisfying states:"] return all(keyword in file_prefix.contents_header for keyword in keywords)
15
240
38
278
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,659
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
1317,1318
1311,1346
sniff_prefix
Castep
1328,1346
1318,1346
@build_sniff_from_prefix class Castep(Text): """Report on a CASTEP calculation""" file_ext = "castep" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
@build_sniff_from_prefix class Castep(Text): """Report on a CASTEP calculation""" file_ext = "castep" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """Determines whether the file is a CASTEP log >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_...
castep_header = [ "+-------------------------------------------------+", "| |", "| CCC AA SSS TTTTT EEEEE PPPP |", "| C A A S T E P P |", "| C A...
"""Determines whether the file is a CASTEP log >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('Si.castep') >>> Castep().sniff(fname) True >>> fname = get_test_fname('Si.param') >>> Castep().sniff(fname) False """ ...
69
179
229
408
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,660
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
142,143
136,149
set_meta
DataManagerJson
143,149
143,149
class DataManagerJson(Json): file_ext = "data_manager_json" MetadataElement( name="data_tables", default=None, desc="Data tables represented by this dataset", readonly=True, visible=True ) def set_meta(self, dataset: DatasetProtocol, overwrite: bool = True, **kwd): FILL_FUNC_BODY
class DataManagerJson(Json): file_ext = "data_manager_json" MetadataElement( name="data_tables", default=None, desc="Data tables represented by this dataset", readonly=True, visible=True ) def set_meta(self, dataset: DatasetProtocol, overwrite: bool = True, **kwd): FILL_FUNC_BODY
super().set_meta(dataset=dataset, overwrite=overwrite, **kwd) with open(dataset.get_file_name()) as fh: data_tables = json.load(fh)["data_tables"] dataset.metadata.data_tables = data_tables
super().set_meta(dataset=dataset, overwrite=overwrite, **kwd) with open(dataset.get_file_name()) as fh: data_tables = json.load(fh)["data_tables"] dataset.metadata.data_tables = data_tables
13
97
78
175
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,661
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
157,158
149,180
set_meta
ExpressionJson
159,180
158,180
class ExpressionJson(Json): """Represents the non-data input or output to a tool or workflow.""" file_ext = "json" MetadataElement( name="json_type", default=None, desc="JavaScript or JSON type of expression", readonly=True, visible=True ) def set_meta(self, dataset: DatasetProtocol, overw...
class ExpressionJson(Json): """Represents the non-data input or output to a tool or workflow.""" file_ext = "json" MetadataElement( name="json_type", default=None, desc="JavaScript or JSON type of expression", readonly=True, visible=True ) def set_meta(self, dataset: DatasetProtocol, overw...
if dataset.has_data(): json_type = "null" file_path = dataset.get_file_name() try: with open(file_path) as f: obj = json.load(f) if isinstance(obj, int): json_type = "int" elif...
""" """ if dataset.has_data(): json_type = "null" file_path = dataset.get_file_name() try: with open(file_path) as f: obj = json.load(f) if isinstance(obj, int): json_type = "int" ...
57
121
221
342
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,662
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
1399,1400
1393,1424
sniff_prefix
FormattedDensity
1413,1424
1400,1424
@build_sniff_from_prefix class FormattedDensity(Text): """Final electron density from a CASTEP calculation written to an ASCII file""" file_ext = "den_fmt" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
@build_sniff_from_prefix class FormattedDensity(Text): """Final electron density from a CASTEP calculation written to an ASCII file""" file_ext = "den_fmt" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """Determines whether the file contains electron densities in the CASTEP den_fmt form...
begin_header = "BEGIN header" end_header = 'END header: data is "<a b c> charge" in units of electrons/grid_point * number' grid_points = "of grid_points" end_header_spin = 'END header: data is "<a b c> charge spin" in units of electrons/grid_point * nu' grid_points_spin = "mber ...
"""Determines whether the file contains electron densities in the CASTEP den_fmt format >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('Si.den_fmt') >>> FormattedDensity().sniff(fname) True >>> fname = get_test_fname('YbCuAs2.den_fmt') ...
74
240
209
449
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,663
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
585,586
554,613
_looks_like_geojson
GeoJson
590,613
586,613
@build_sniff_from_prefix class GeoJson(Json): """ GeoJSON is a geospatial data interchange format based on JavaScript Object Notation (JSON). https://tools.ietf.org/html/rfc7946 """ file_ext = "geojson" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: super().set_peek(datas...
@build_sniff_from_prefix class GeoJson(Json): """ GeoJSON is a geospatial data interchange format based on JavaScript Object Notation (JSON). https://tools.ietf.org/html/rfc7946 """ file_ext = "geojson" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: super().set_peek(datas...
is_geojson = False try: with open(file_prefix.filename) as fh: segment_str = fh.read(load_size) if any( x in segment_str for x in [ "Point", "MultiPoint", ...
""" One of "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", and "GeometryCollection" needs to be present. All of "type", "geometry", and "coordinates" needs to be present. """ is_geojson = False try: with open(file_prefix.file...
46
429
178
607
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,664
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
1001,1002
991,1041
sniff_prefix
Gfa1
1010,1041
1002,1041
@build_sniff_from_prefix class Gfa1(Text): """ Graphical Fragment Assembly (GFA) 1.0 http://gfa-spec.github.io/GFA-spec/GFA1.html """ file_ext = "gfa1" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
@build_sniff_from_prefix class Gfa1(Text): """ Graphical Fragment Assembly (GFA) 1.0 http://gfa-spec.github.io/GFA-spec/GFA1.html """ file_ext = "gfa1" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ >>> from galaxy.datatypes.sniff import get_test_fname >>...
found_valid_lines = False for line in iter_headers(file_prefix, "\t"): if line[0].startswith("#"): continue if line[0] == "H": return len(line) == 2 and line[1] == "VN:Z:1.0" elif line[0] == "S": if len(line) < 3: ...
""" >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('big.gfa1') >>> Gfa1().sniff(fname) True >>> Gfa2().sniff(fname) False """ found_valid_lines = False for line in iter_headers(file_prefix, "\t"): ...
98
183
304
487
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,665
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
1051,1052
1041,1087
sniff_prefix
Gfa2
1060,1087
1052,1087
@build_sniff_from_prefix class Gfa2(Text): """ Graphical Fragment Assembly (GFA) 2.0 https://github.com/GFA-spec/GFA-spec/blob/master/GFA2.md """ file_ext = "gfa2" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
@build_sniff_from_prefix class Gfa2(Text): """ Graphical Fragment Assembly (GFA) 2.0 https://github.com/GFA-spec/GFA-spec/blob/master/GFA2.md """ file_ext = "gfa2" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ >>> from galaxy.datatypes.sniff import get_test_fnam...
found_valid_lines = False for line in iter_headers(file_prefix, "\t"): if line[0].startswith("#"): continue if line[0] == "H": return len(line) >= 2 and line[1] == "VN:Z:2.0" elif line[0] == "S": if len(line) < 3: ...
""" >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('sample.gfa2') >>> Gfa2().sniff(fname) True >>> Gfa1().sniff(fname) False """ found_valid_lines = False for line in iter_headers(file_prefix, "\t"): ...
85
187
266
453
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,666
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
68,69
49,87
sniff_prefix
Html
80,87
69,87
@build_sniff_from_prefix class Html(Text): """Class describing an html file""" edam_format = "format_2331" file_ext = "html" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: if not dataset.dataset.purged: dataset.peek = "HTML file" dataset.blurb = nice_size(...
@build_sniff_from_prefix class Html(Text): """Class describing an html file""" edam_format = "format_2331" file_ext = "html" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: if not dataset.dataset.purged: dataset.peek = "HTML file" dataset.blurb = nice_size(...
headers = iter_headers(file_prefix, None) for hdr in headers: if hdr and hdr[0].lower().find("<html>") >= 0: return True return False
""" Determines whether the file is in html format >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname( 'complete.bed' ) >>> Html().sniff( fname ) False >>> fname = get_test_fname( 'file.html' ) >>> Html().sniff( fname ) ...
18
320
61
381
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,667
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
933,934
927,956
sniff_prefix
IQTree
953,956
934,956
@build_sniff_from_prefix class IQTree(Text): """IQ-TREE format""" file_ext = "iqtree" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
@build_sniff_from_prefix class IQTree(Text): """IQ-TREE format""" file_ext = "iqtree" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Detect the IQTree file Scattered text file containing various headers and data types. >>> from galaxy.datatypes.sniff...
return file_prefix.startswith("IQ-TREE")
""" Detect the IQTree file Scattered text file containing various headers and data types. >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('example.iqtree') >>> IQTree().sniff(fname) True >>> fname = get_test_fnam...
2
227
22
249
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,668
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
536,537
483,554
set_meta
ImgtJson
540,554
537,554
@build_sniff_from_prefix class ImgtJson(Json): """ https://github.com/repseqio/library-imgt/releases Data coming from IMGT server may be used for academic research only, provided that it is referred to IMGT®, and cited as: "IMGT®, the international ImMunoGeneTics information system® http://www.i...
@build_sniff_from_prefix class ImgtJson(Json): """ https://github.com/repseqio/library-imgt/releases Data coming from IMGT server may be used for academic research only, provided that it is referred to IMGT®, and cited as: "IMGT®, the international ImMunoGeneTics information system® http://www.i...
if dataset.has_data(): with open(dataset.get_file_name()) as fh: try: json_dict = json.load(fh) tax_names = [] for entry in json_dict: if "taxonId" in entry: names = "%d: %...
""" Store metadata information from the imgt file. """ if dataset.has_data(): with open(dataset.get_file_name()) as fh: try: json_dict = json.load(fh) tax_names = [] for entry in json_dict: ...
35
675
148
823
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,669
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
224,233
180,268
_display_data_trusted
Ipynb
233,262
233,262
@build_sniff_from_prefix class Ipynb(Json): file_ext = "ipynb" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: if not dataset.dataset.purged: dataset.peek = get_file_peek(dataset.get_file_name()) dataset.blurb = "Jupyter Notebook" else: dataset.p...
@build_sniff_from_prefix class Ipynb(Json): file_ext = "ipynb" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: if not dataset.dataset.purged: dataset.peek = get_file_peek(dataset.get_file_name()) dataset.blurb = "Jupyter Notebook" else: dataset.p...
headers = kwd.pop("headers", {}) preview = string_as_bool(preview) if to_ext or not preview: return self._serve_raw(dataset, to_ext, headers, **kwd) else: with tempfile.NamedTemporaryFile(delete=False) as ofile_handle: ofilename = ofile_handle.name...
headers = kwd.pop("headers", {}) preview = string_as_bool(preview) if to_ext or not preview: return self._serve_raw(dataset, to_ext, headers, **kwd) else: with tempfile.NamedTemporaryFile(delete=False) as ofile_handle: ofilename = ofile_handle.name...
70
605
307
912
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,670
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
92,93
87,136
set_peek
Json
93,100
93,100
@build_sniff_from_prefix class Json(Text): edam_format = "format_3464" file_ext = "json" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: FILL_FUNC_BODY def get_mime(self) -> str: """Returns the mime type of the datatype""" return "application/json" def sniff_prefix(self...
@build_sniff_from_prefix class Json(Text): edam_format = "format_3464" file_ext = "json" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: FILL_FUNC_BODY def get_mime(self) -> str: """Returns the mime type of the datatype""" return "application/json" def sniff_prefix(self...
if not dataset.dataset.purged: dataset.peek = get_file_peek(dataset.get_file_name()) dataset.blurb = "JavaScript Object Notation (JSON)" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disc"
if not dataset.dataset.purged: dataset.peek = get_file_peek(dataset.get_file_name()) dataset.blurb = "JavaScript Object Notation (JSON)" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disc"
25
453
88
541
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,671
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
632,633
613,651
sniff_prefix
Obo
637,651
633,651
@build_sniff_from_prefix class Obo(Text): """ OBO file format description https://owlcollab.github.io/oboformat/doc/GO.format.obo-1_2.html """ edam_data = "data_0582" edam_format = "format_2549" file_ext = "obo" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: if no...
@build_sniff_from_prefix class Obo(Text): """ OBO file format description https://owlcollab.github.io/oboformat/doc/GO.format.obo-1_2.html """ edam_data = "data_0582" edam_format = "format_2549" file_ext = "obo" def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: if no...
stanza = re.compile(r"^\[.*\]$") handle = file_prefix.string_io() first_line = handle.readline() if not first_line.startswith("format-version:"): return False for line in handle: if stanza.match(line.strip()): # a stanza needs to begin wit...
""" Try to guess the Obo filetype. It usually starts with a "format-version:" string and has several stanzas which starts with "id:". """ stanza = re.compile(r"^\[.*\]$") handle = file_prefix.string_io() first_line = handle.readline() if not first_line.sta...
36
283
136
419
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,672
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
966,967
956,991
sniff_prefix
Paf
973,991
967,991
@build_sniff_from_prefix class Paf(Text): """ PAF: a Pairwise mApping Format https://github.com/lh3/miniasm/blob/master/PAF.md """ file_ext = "paf" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
@build_sniff_from_prefix class Paf(Text): """ PAF: a Pairwise mApping Format https://github.com/lh3/miniasm/blob/master/PAF.md """ file_ext = "paf" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ >>> from galaxy.datatypes.sniff import get_test_fname >>> fn...
found_valid_lines = False for line in iter_headers(file_prefix, "\t"): if len(line) < 12: return False for i in (1, 2, 3, 6, 7, 8, 9, 10, 11): int(line[i]) if line[4] not in ("+", "-"): return False if not (0...
""" >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('A-3105.paf') >>> Paf().sniff(fname) True """ found_valid_lines = False for line in iter_headers(file_prefix, "\t"): if len(line) < 12: return ...
74
166
222
388
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,673
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
1352,1353
1346,1393
sniff_prefix
Param
1366,1393
1353,1393
@build_sniff_from_prefix class Param(Yaml): """CASTEP parameter input file""" file_ext = "param" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
@build_sniff_from_prefix class Param(Yaml): """CASTEP parameter input file""" file_ext = "param" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Modified version of the normal Yaml sniff that also checks for a valid CASTEP task key-value pair, which is not case ...
valid_tasks = [ "SINGLEPOINT", "BANDSTRUCTURE", "GEOMETRYOPTIMIZATION", "GEOMETRYOPTIMISATION", "MOLECULARDYNAMICS", "OPTICS", "PHONON", "EFIELD", "PHONON+EFIELD", "TRANSITIONSTATESEARCH", ...
""" Modified version of the normal Yaml sniff that also checks for a valid CASTEP task key-value pair, which is not case sensitive >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('Si.param') >>> Param().sniff(fname) True ...
63
198
294
492
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,674
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
1280,1281
1274,1288
sniff_prefix
PithyaModel
1284,1288
1281,1288
@build_sniff_from_prefix class PithyaModel(Text): """Pithya model format""" file_ext = "pithya.model" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
@build_sniff_from_prefix class PithyaModel(Text): """Pithya model format""" file_ext = "pithya.model" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Determines whether the file is in .pithya.model format """ FILL_FUNC_BODY
keywords = ["VARS", "EQ", "THRES"] return all(keyword in file_prefix.contents_header for keyword in keywords)
""" Determines whether the file is in .pithya.model format """ keywords = ["VARS", "EQ", "THRES"] return all(keyword in file_prefix.contents_header for keyword in keywords)
13
96
40
136
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,675
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
1267,1268
1261,1274
sniff_prefix
PithyaProperty
1271,1274
1268,1274
@build_sniff_from_prefix class PithyaProperty(Text): """Pithya CTL property format""" file_ext = "pithya.property" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY
@build_sniff_from_prefix class PithyaProperty(Text): """Pithya CTL property format""" file_ext = "pithya.property" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Determines whether the file is in .pithya.property format """ FILL_FUNC_BODY
return re.search(r":\?[a-zA-Z0-9_]+[ ]*=", file_prefix.contents_header) is not None
""" Determines whether the file is in .pithya.property format """ return re.search(r":\?[a-zA-Z0-9_]+[ ]*=", file_prefix.contents_header) is not None
7
98
45
143
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,676
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
1294,1295
1288,1311
sniff_prefix
PithyaResult
1298,1303
1295,1303
@build_sniff_from_prefix class PithyaResult(Json): """Pithya result format""" file_ext = "pithya.result" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY def _looks_like_pithya_result(self, file_prefix: FilePrefix) -> bool: content = open(file_prefix.filename).read() ...
@build_sniff_from_prefix class PithyaResult(Json): """Pithya result format""" file_ext = "pithya.result" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Determines whether the file is in .pithya.result format """ FILL_FUNC_BODY def _looks_like_pithya_result(self, fi...
is_pithya_result = False if self._looks_like_json(file_prefix): is_pithya_result = self._looks_like_pithya_result(file_prefix) return is_pithya_result
""" Determines whether the file is in .pithya.result format """ is_pithya_result = False if self._looks_like_json(file_prefix): is_pithya_result = self._looks_like_pithya_result(file_prefix) return is_pithya_result
10
197
70
267
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,677
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
787,788
756,832
set_meta
SnpEffDb
788,832
788,832
class SnpEffDb(Text): """Class describing a SnpEff genome build""" edam_format = "format_3624" file_ext = "snpeffdb" MetadataElement(name="genome_version", default=None, desc="Genome Version", readonly=True, visible=True) MetadataElement(name="snpeff_version", default="SnpEff4.0", desc="SnpEff Vers...
class SnpEffDb(Text): """Class describing a SnpEff genome build""" edam_format = "format_3624" file_ext = "snpeffdb" MetadataElement(name="genome_version", default=None, desc="Genome Version", readonly=True, visible=True) MetadataElement(name="snpeff_version", default="SnpEff4.0", desc="SnpEff Vers...
super().set_meta(dataset, overwrite=overwrite, **kwd) data_dir = dataset.extra_files_path # search data_dir/genome_version for files regulation_pattern = "regulation_(.+).bin" # annotation files that are included in snpEff by a flag annotations_dict = {"nextProt.bin": "-...
super().set_meta(dataset, overwrite=overwrite, **kwd) data_dir = dataset.extra_files_path # search data_dir/genome_version for files regulation_pattern = "regulation_(.+).bin" # annotation files that are included in snpEff by a flag annotations_dict = {"nextProt.bin": "-...
154
459
635
1,094
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,678
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
880,881
832,927
regenerate_primary_file
SnpSiftDbNSFP
884,892
881,892
class SnpSiftDbNSFP(Text): """ Class describing a dbNSFP database prepared fpr use by SnpSift dbnsfp The dbNSFP file is a tabular file with 1 header line. The first 4 columns are required to be: chrom pos ref alt These match columns 1,2,4,5 of the VCF file SnpSift requires the file to be block-...
class SnpSiftDbNSFP(Text): """ Class describing a dbNSFP database prepared fpr use by SnpSift dbnsfp The dbNSFP file is a tabular file with 1 header line. The first 4 columns are required to be: chrom pos ref alt These match columns 1,2,4,5 of the VCF file SnpSift requires the file to be block-...
annotations = f"dbNSFP Annotations: {','.join(dataset.metadata.annotation)}\n" with open(dataset.get_file_name(), "a") as f: if dataset.metadata.bgzip: bn = dataset.metadata.bgzip f.write(bn) f.write("\n") f.write(annotations)
""" cannot do this until we are setting metadata """ annotations = f"dbNSFP Annotations: {','.join(dataset.metadata.annotation)}\n" with open(dataset.get_file_name(), "a") as f: if dataset.metadata.bgzip: bn = dataset.metadata.bgzip f.w...
18
1,081
100
1,181
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,679
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
1219,1220
1203,1234
set_peek
StormCheck
1220,1234
1220,1234
@build_sniff_from_prefix class StormCheck(Text): """ Storm PCTL model checking result file containing boolean or numerical result. """ file_ext = "storm.check" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Determines whether the file is in .storm.check format ...
@build_sniff_from_prefix class StormCheck(Text): """ Storm PCTL model checking result file containing boolean or numerical result. """ file_ext = "storm.check" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Determines whether the file is in .storm.check format ...
if not dataset.dataset.purged: with open(dataset.get_file_name()) as result: answer = "" for line in result: if "Result (for initial states):" in line: answer = line.split()[-1] break data...
if not dataset.dataset.purged: with open(dataset.get_file_name()) as result: answer = "" for line in result: if "Result (for initial states):" in line: answer = line.split()[-1] break data...
47
165
147
312
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,680
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
1194,1195
1178,1203
set_peek
StormSample
1195,1203
1195,1203
@build_sniff_from_prefix class StormSample(Text): """ Storm PCTL parameter synthesis result file containing probability function of parameters. """ file_ext = "storm.sample" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Determines whether the file is in .storm.sa...
@build_sniff_from_prefix class StormSample(Text): """ Storm PCTL parameter synthesis result file containing probability function of parameters. """ file_ext = "storm.sample" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Determines whether the file is in .storm.sa...
if not dataset.dataset.purged: dataset.peek = "Storm-pars sample results." dataset.blurb = nice_size(dataset.get_size()) else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
if not dataset.dataset.purged: dataset.peek = "Storm-pars sample results." dataset.blurb = nice_size(dataset.get_size()) else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
24
167
85
252
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,681
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/text.py
1110,1111
1087,1131
_looks_like_yaml
Yaml
1111,1131
1111,1131
@build_sniff_from_prefix class Yaml(Text): """Yaml files""" file_ext = "yaml" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Try to load the string with the yaml module. If successful it's a yaml file. """ return self._looks_like_yaml(file_prefix) def get...
@build_sniff_from_prefix class Yaml(Text): """Yaml files""" file_ext = "yaml" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: """ Try to load the string with the yaml module. If successful it's a yaml file. """ return self._looks_like_yaml(file_prefix) def get...
# Pattern used by SequenceSplitLocations if file_prefix.file_size < 50000 and not file_prefix.truncated: # If the file is small enough - don't guess just check. try: item = yaml.safe_load(file_prefix.contents_header) assert isinstance(item, (list, ...
# Pattern used by SequenceSplitLocations if file_prefix.file_size < 50000 and not file_prefix.truncated: # If the file is small enough - don't guess just check. try: item = yaml.safe_load(file_prefix.contents_header) assert isinstance(item, (list, ...
82
297
253
550
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
""" Clearing house for generic text datatypes that are not XML or tabular. """ import gzip import json import logging import os import re import shlex import subprocess import tempfile from typing import ( IO, Optional, Tuple, ) import yaml from galaxy.datatypes.data import ( get_file_peek, Heade...
45,682
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/tracks.py
50,51
25,65
set_peek
UCSCTrackHub
51,57
51,57
class UCSCTrackHub(Html): """ Datatype for UCSC TrackHub """ file_ext = "trackhub" composite_type = "auto_primary_file" def generate_primary_file(self, dataset: HasExtraFilesAndMetadata) -> str: """ This is called only at upload to write the html file cannot rename the ...
class UCSCTrackHub(Html): """ Datatype for UCSC TrackHub """ file_ext = "trackhub" composite_type = "auto_primary_file" def generate_primary_file(self, dataset: HasExtraFilesAndMetadata) -> str: """ This is called only at upload to write the html file cannot rename the ...
if not dataset.dataset.purged: dataset.peek = "Track Hub structure: Visualization in UCSC Track Hub" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
if not dataset.dataset.purged: dataset.peek = "Track Hub structure: Visualization in UCSC Track Hub" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
26
401
70
471
""" Datatype classes for tracks/track views within galaxy. """ import logging from galaxy.datatypes.protocols import ( DatasetProtocol, HasExtraFilesAndMetadata, ) from galaxy.datatypes.text import Html from . import binary log = logging.getLogger(__name__) # GeneTrack is no longer supported but leaving th...
""" Datatype classes for tracks/track views within galaxy. """ import logging from galaxy.datatypes.protocols import ( DatasetProtocol, HasExtraFilesAndMetadata, ) from galaxy.datatypes.text import Html from . import binary log = logging.getLogger(__name__) # GeneTrack is no longer supported but leaving th...
45,683
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/triples.py
199,200
185,209
set_peek
HDT
201,209
200,209
class HDT(binary.Binary, Triples): """ The HDT triple data format """ edam_format = "format_2376" file_ext = "hdt" def sniff(self, filename: str) -> bool: with open(filename, "rb") as f: if f.read(4) == b"$HDT": return True return False def set_...
class HDT(binary.Binary, Triples): """ The HDT triple data format """ edam_format = "format_2376" file_ext = "hdt" def sniff(self, filename: str) -> bool: with open(filename, "rb") as f: if f.read(4) == b"$HDT": return True return False def set_...
if not dataset.dataset.purged: dataset.peek = data.get_file_peek(dataset.get_file_name()) dataset.blurb = "HDT triple data" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
"""Set the peek and blurb text""" if not dataset.dataset.purged: dataset.peek = data.get_file_peek(dataset.get_file_name()) dataset.blurb = "HDT triple data" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
24
153
89
242
""" Triple format classes """ import logging import re from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, ) from . import ( binary, data, text, xml, ) log = logg...
""" Triple format classes """ import logging import re from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, ) from . import ( binary, data, text, xml, ) log = logg...
45,684
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/triples.py
175,176
159,185
set_peek
Jsonld
177,185
176,185
@build_sniff_from_prefix class Jsonld(text.Json, Triples): """ The JSON-LD data format """ # format not defined in edam so we use the json format number edam_format = "format_3464" file_ext = "jsonld" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: if self._looks_like_json...
@build_sniff_from_prefix class Jsonld(text.Json, Triples): """ The JSON-LD data format """ # format not defined in edam so we use the json format number edam_format = "format_3464" file_ext = "jsonld" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: if self._looks_like_json...
if not dataset.dataset.purged: dataset.peek = data.get_file_peek(dataset.get_file_name()) dataset.blurb = "JSON-LD triple data" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
"""Set the peek and blurb text""" if not dataset.dataset.purged: dataset.peek = data.get_file_peek(dataset.get_file_name()) dataset.blurb = "JSON-LD triple data" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
24
200
90
290
""" Triple format classes """ import logging import re from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, ) from . import ( binary, data, text, xml, ) log = logg...
""" Triple format classes """ import logging import re from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, ) from . import ( binary, data, text, xml, ) log = logg...
45,685
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/triples.py
92,93
78,102
set_peek
N3
94,102
93,102
class N3(data.Text, Triples): """ The N3 triple data format """ edam_format = "format_3257" file_ext = "n3" def sniff(self, filename: str) -> bool: """ Returns false and the user must manually set. """ return False def set_peek(self, dataset: DatasetProtoco...
class N3(data.Text, Triples): """ The N3 triple data format """ edam_format = "format_3257" file_ext = "n3" def sniff(self, filename: str) -> bool: """ Returns false and the user must manually set. """ return False def set_peek(self, dataset: DatasetProtoco...
if not dataset.dataset.purged: dataset.peek = data.get_file_peek(dataset.get_file_name()) dataset.blurb = "Notation-3 Triple data" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
"""Set the peek and blurb text""" if not dataset.dataset.purged: dataset.peek = data.get_file_peek(dataset.get_file_name()) dataset.blurb = "Notation-3 Triple data" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk" ...
24
137
92
229
""" Triple format classes """ import logging import re from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, ) from . import ( binary, data, text, xml, ) log = logg...
""" Triple format classes """ import logging import re from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, ) from . import ( binary, data, text, xml, ) log = logg...
45,686
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/triples.py
62,63
53,78
sniff_prefix
NTriples
63,68
63,68
@build_sniff_from_prefix class NTriples(data.Text, Triples): """ The N-Triples triple data format """ edam_format = "format_3256" file_ext = "nt" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: """S...
@build_sniff_from_prefix class NTriples(data.Text, Triples): """ The N-Triples triple data format """ edam_format = "format_3256" file_ext = "nt" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: FILL_FUNC_BODY def set_peek(self, dataset: DatasetProtocol, **kwd) -> None: """S...
# <http://example.org/dir/relfile> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/type> . if re.compile(r"<[^>]*>\s<[^>]*>\s<[^>]*>\s\.").search(file_prefix.contents_header): return True return False
# <http://example.org/dir/relfile> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.org/type> . if re.compile(r"<[^>]*>\s<[^>]*>\s<[^>]*>\s\.").search(file_prefix.contents_header): return True return False
11
215
117
332
""" Triple format classes """ import logging import re from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, ) from . import ( binary, data, text, xml, ) log = logg...
""" Triple format classes """ import logging import re from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, ) from . import ( binary, data, text, xml, ) log = logg...
45,687
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/triples.py
149,150
131,159
set_peek
Rdf
151,159
150,159
@build_sniff_from_prefix class Rdf(xml.GenericXml, Triples): """ Resource Description Framework format (http://www.w3.org/RDF/). """ edam_format = "format_3261" file_ext = "rdf" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: # <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-...
@build_sniff_from_prefix class Rdf(xml.GenericXml, Triples): """ Resource Description Framework format (http://www.w3.org/RDF/). """ edam_format = "format_3261" file_ext = "rdf" def sniff_prefix(self, file_prefix: FilePrefix) -> bool: # <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-...
if not dataset.dataset.purged: dataset.peek = data.get_file_peek(dataset.get_file_name()) dataset.blurb = "RDF/XML triple data" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
"""Set the peek and blurb text""" if not dataset.dataset.purged: dataset.peek = data.get_file_peek(dataset.get_file_name()) dataset.blurb = "RDF/XML triple data" else: dataset.peek = "file does not exist" dataset.blurb = "file purged from disk"
24
290
91
381
""" Triple format classes """ import logging import re from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, ) from . import ( binary, data, text, xml, ) log = logg...
""" Triple format classes """ import logging import re from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, ) from . import ( binary, data, text, xml, ) log = logg...
45,688
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy
/home/hieuvd/dung_repo/raw/stars_03/galaxyproject_galaxy/galaxy/lib/galaxy/datatypes/triples.py
225,226
209,242
sniff_prefix
Sbol
226,231
226,231
@build_sniff_from_prefix class Sbol(data.Text, Triples): """ The SBOL data format (https://sbolstandard.org). """ MetadataElement(name="version", default="", readonly=True, visible=True, optional=True) edam_format = "format_3725" file_ext = "sbol" def set_meta(self, dataset: DatasetProtoco...
@build_sniff_from_prefix class Sbol(data.Text, Triples): """ The SBOL data format (https://sbolstandard.org). """ MetadataElement(name="version", default="", readonly=True, visible=True, optional=True) edam_format = "format_3725" file_ext = "sbol" def set_meta(self, dataset: DatasetProtoco...
# http://sbols.org/v2# if file_prefix.search(SBOL_PATTERN): return True return False
# http://sbols.org/v2# if file_prefix.search(SBOL_PATTERN): return True return False
8
366
44
410
""" Triple format classes """ import logging import re from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, ) from . import ( binary, data, text, xml, ) log = logg...
""" Triple format classes """ import logging import re from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.protocols import DatasetProtocol from galaxy.datatypes.sniff import ( build_sniff_from_prefix, FilePrefix, ) from . import ( binary, data, text, xml, ) log = logg...