Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/arjunrajlaboratory/atac-seq_pipeline_paired-end
15 July 2021, 06:34:57 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    No releases to show
  • c3be876
  • /
  • /
  • concat_zipped_fastq_files_from_illumina.py
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:35a5e8438af7251a1f8b6567be69d3ff52b65d71
origin badgedirectory badge
swh:1:dir:c3be8763ed0c43d17cb09b29b894cfb899d1fc14
origin badgerevision badge
swh:1:rev:b165422254188ce4f89074374967f3390fd5d875
origin badgesnapshot badge
swh:1:snp:1f6cc5c29465c6dc6c689238737976557c2a04f5

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: b165422254188ce4f89074374967f3390fd5d875 authored by emsanford on 25 February 2021, 23:34:09 UTC
Update concat_zipped_fastq_files_from_illumina.py
Tip revision: b165422
concat_zipped_fastq_files_from_illumina.py
import glob
import sys
import os
import re
import time 


base_directory = sys.argv[1]     # e.g. '/home/esanford/data/HD3_ATAC-seq/data_from_illumina/FASTQ_Generation_2018-10-31_08_01_22Z-134203162'
output_directory = sys.argv[2]   # e.g. '/home/esanford/data/HD3_ATAC-seq/concatenated_data'
# replicate = 'rep1'
fastq_files = glob.glob(base_directory + '/*/*.fastq*')
sample_dict = {}
number_of_lanes = 4
print fastq_files

for f in fastq_files:
	sample_dir_string = f.split('/')[-2]
	fastq_file_string = f.split('/')[-1]

	sample_name_regex = '(.*)(_S)([0-9]+)(_L00.*)'
	re_match_obj = re.match(sample_name_regex, fastq_file_string)
	sample_name = re_match_obj.group(1)
	sample_number = int(re_match_obj.group(3))

	print "{0} : {1}".format(sample_number, sample_name)
	#sample_key = "{0:02d}-{1}".format(sample_number, sample_name)
	# sample_key = sample_name + '-' + replicate
	sample_key = sample_name


	if sample_key not in sample_dict:
		sample_dict[sample_key] = []

	sample_dict[sample_key].append(f)


for sample, filepaths in sample_dict.items():
	read1_files = filter(lambda x: '_R1_' in x, filepaths)
	read2_files = filter(lambda x: '_R2_' in x, filepaths)

	print read1_files
	print read2_files

	assert(len(read1_files) == number_of_lanes)
	assert(len(read2_files) == number_of_lanes)

	r1_output_file = output_directory + '/' + sample + '_R1.fastq'
	cmd1 = 'zcat {0} > {1}'.format(' '.join(read1_files), r1_output_file)
	print cmd1
	os.system(cmd1)
	r2_output_file = output_directory + '/' + sample + '_R2.fastq'
	cmd2 = 'zcat {0} > {1}'.format(' '.join(read2_files), r2_output_file)
	print cmd2
	os.system(cmd2)

	# delay five seconds in case previous step isn't completely finished before proceeding to next step
	time.sleep(5)

	#compress files
	os.system('bsub gzip {0}'.format(r1_output_file))
	os.system('bsub gzip {0}'.format(r2_output_file))




back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API