Esempio n. 1
0
external_file_contents = "foo"

with open(os.path.join(efd_path, external_path), "wb") as f:
    f.write(external_file_contents)

# Upload data
try:
    ext_ds = kive.add_dataset('ExternalDatasetFile',
                              'External copy of 1234A_R1',
                              None,
                              None,
                              None, ["Everyone"],
                              externalfiledirectory=efd_name,
                              external_path=external_path)
except KiveMalformedDataException:
    ext_ds = kive.find_datasets(name='ExternalDatasetFile')[0]

# Now get the file and check that the results make sense.
retrieved_ext_ds = kive.get_dataset(ext_ds.dataset_id)

print(retrieved_ext_ds.__dict__)

assert retrieved_ext_ds.dataset_id == ext_ds.dataset_id
assert retrieved_ext_ds.filename == ext_ds.filename
assert retrieved_ext_ds.name == "ExternalDatasetFile"
assert retrieved_ext_ds.cdt.cdt_id == "__raw__"
assert retrieved_ext_ds.users_allowed == []
assert retrieved_ext_ds.groups_allowed == ["Everyone"]
assert retrieved_ext_ds.externalfiledirectory == efd_name
assert retrieved_ext_ds.external_path == external_path
Esempio n. 2
0
from kiveapi import KiveAPI, KiveMalformedDataException

# This assumes you have a Kive instance listening on port 8000, running
# the demo fixture.  In production, you wouldn't put your authentication
# information in source code.
KiveAPI.SERVER_URL = 'http://localhost:8000'
kive = KiveAPI()
kive.login('kive', 'kive')

# Upload data
try:
    fastq1 = kive.add_dataset('New fastq file 1', 'None', open('exfastq1.fastq', 'r'), None, None, ["Everyone"])
except KiveMalformedDataException:
    fastq1 = kive.find_datasets(name='New fastq file 1')[0]

try:
    fastq2 = kive.add_dataset('New fastq file 2', 'None', open('exfastq2.fastq', 'r'), None, None, ["Everyone"])
except KiveMalformedDataException:
    fastq2 = kive.find_datasets(name='New fastq file 2')[0]

# Get the pipeline by family ID
pipeline_family = kive.get_pipeline_family(2)

print('Using data:')
print(fastq1, fastq2)

print('With pipeline:')
print(pipeline_family.published_or_latest())

# Create a RunBatch.
rb = kive.create_run_batch(
Esempio n. 3
0
    f.write(external_file_contents)

# Upload data
try:
    ext_ds = kive.add_dataset(
        'ExternalDatasetFile',
        'External copy of 1234A_R1',
        None,
        None,
        None,
        ["Everyone"],
        externalfiledirectory=efd_name,
        external_path=external_path
    )
except KiveMalformedDataException:
    ext_ds = kive.find_datasets(name='ExternalDatasetFile')[0]

# Now get the file and check that the results make sense.
retrieved_ext_ds = kive.get_dataset(ext_ds.dataset_id)

print(retrieved_ext_ds.__dict__)

assert retrieved_ext_ds.dataset_id == ext_ds.dataset_id
assert retrieved_ext_ds.filename == ext_ds.filename
assert retrieved_ext_ds.name == "ExternalDatasetFile"
assert retrieved_ext_ds.cdt.cdt_id == "__raw__"
assert retrieved_ext_ds.users_allowed == []
assert retrieved_ext_ds.groups_allowed == ["Everyone"]
assert retrieved_ext_ds.externalfiledirectory == efd_name
assert retrieved_ext_ds.external_path == external_path
Esempio n. 4
0
from kiveapi import KiveAPI

# Use HTTPS on a real server, so your password is encrypted.
KiveAPI.SERVER_URL = 'http://localhost:8000'
# Don't put your real password in source code, store it in a text file
# that is only readable by your user account or some more secure storage.
kive = KiveAPI()
kive.login('kive', 'kive')

# Get the data by ID
fastq1 = kive.get_dataset(2)
fastq2 = kive.get_dataset(3)

# or get the data by name
fastq1 = kive.find_datasets(name='1234A_R1.fastq')[0]
fastq2 = kive.find_datasets(name='1234A_R2.fastq')[0]

# Pipeline
pipeline = kive.get_pipeline(13)

print(pipeline)
# # Get the pipeline by family ID
# pipeline_family = kive.get_pipeline_family(2)
#
# print('Using data:')
# print(fastq1, fastq2)
#
# print('With pipeline:')
# print(pipeline_family.published_or_latest())
Esempio n. 5
0
from kiveapi import KiveAPI

# Use HTTPS on a real server, so your password is encrypted.
KiveAPI.SERVER_URL = 'http://localhost:8000'
# Don't put your real password in source code, store it in a text file
# that is only readable by your user account or some more secure storage.
kive = KiveAPI()
kive.login('kive', 'kive')

# Get the data by ID
fastq1 = kive.get_dataset(2)
fastq2 = kive.get_dataset(3)

# or get the data by name
fastq1 = kive.find_datasets(name='1234A_R1.fastq')[0]
fastq2 = kive.find_datasets(name='1234A_R2.fastq')[0]

# Pipeline
pipeline = kive.get_pipeline(13)

print(pipeline)
# # Get the pipeline by family ID
# pipeline_family = kive.get_pipeline_family(2)
#
# print('Using data:')
# print(fastq1, fastq2)
#
# print('With pipeline:')
# print(pipeline_family.published_or_latest())
Esempio n. 6
0
from kiveapi import KiveAPI, KiveMalformedDataException

# This assumes you have a Kive instance listening on port 8000, running
# the demo fixture.  In production, you wouldn't put your authentication
# information in source code.
KiveAPI.SERVER_URL = 'http://localhost:8000'
kive = KiveAPI()
kive.login('kive', 'kive')

# Upload data
try:
    fastq1 = kive.add_dataset('New fastq file 1', 'None',
                              open('exfastq1.fastq', 'r'), None, None,
                              ["Everyone"])
except KiveMalformedDataException:
    fastq1 = kive.find_datasets(name='New fastq file 1')[0]

try:
    fastq2 = kive.add_dataset('New fastq file 2', 'None',
                              open('exfastq2.fastq', 'r'), None, None,
                              ["Everyone"])
except KiveMalformedDataException:
    fastq2 = kive.find_datasets(name='New fastq file 2')[0]

# Get the pipeline by family ID
pipeline_family = kive.get_pipeline_family(2)

print('Using data:')
print(fastq1, fastq2)

print('With pipeline:')