% lsmagic
%%bash
mkdir /local/shared/pinsky_lab/sequencing/hiseq_2018_09_24_SEQ18
mkdir /local/shared/pinsky_lab/sequencing/hiseq_2018_09_24_SEQ19
mkdir /local/shared/pinsky_lab/sequencing/hiseq_2018_09_24_SEQ20
mkdir /local/shared/pinsky_lab/sequencing/hiseq_2018_09_24_SEQ21
%%bash
cd ~/02-apcl-ddocent
mkdir 18seq 19seq 20seq 21seq
cd ../18seq/
mkdir bcsplit 01Pool 02Pool 03Pool 04Pool 05Pool 06Pool 07Pool 08Pool 09Pool 10Pool 11Pool 12Pool logs samples scripts
cd bcsplit/
mkdir lane1 lane2
cd ../../19seq/
mkdir bcsplit 01Pool 02Pool 03Pool 04Pool 05Pool 06Pool 07Pool 08Pool 09Pool 10Pool 11Pool 12Pool logs samples scripts
cd bcsplit/
mkdir lane1 lane2
cd ../../20seq/
mkdir bcsplit 01Pool 02Pool 03Pool 04Pool 05Pool 06Pool 07Pool 08Pool 09Pool 10Pool 11Pool 12Pool logs samples scripts
cd bcsplit/
mkdir lane1 lane2
cd ../../21seq/
mkdir bcsplit 01Pool 02Pool 03Pool 04Pool 05Pool 06Pool 07Pool 08Pool 09Pool 10Pool 11Pool 12Pool logs samples scripts
cd bcsplit/
mkdir lane1 lane2
%%bash
cd ~/02-apcl-ddocent
cp 16seq/logs/barcodes 18seq/logs/
cp 16seq/logs/barcodes 19seq/logs
cp 16seq/logs/barcodes 20seq/logs
cp 16seq/logs/barcodes 21seq/logs
started 10am on Monday, finished at about 7:30pm on Monday - took about 10 hours for 576 samples
%%bash
cd ~/02-apcl-ddocent/18seq/bcsplit/lane1
nohup barcode_splitter.py --bcfile ../../logs/index-seq18.tsv --idxread 2 --suffix .fastq.gz /local/shared/pinsky_lab/sequencing/hiseq_2018_09_24_SEQ18/18_APCL_SEQ-for-196-cycles-HLMHLBCX2_1_Read_1_passed_filter.fastq.gz /local/shared/pinsky_lab/sequencing/hiseq_2018_09_24_SEQ18/18_APCL_SEQ-for-196-cycles-HLMHLBCX2_1_Read_2_Index_Read_passed_filter.fastq.gz
cd ~/02-apcl-ddocent/18seq/bcsplit/lane2
nohup barcode_splitter.py --bcfile ../../logs/index-seq18.tsv --idxread 2 --suffix .fastq.gz /local/shared/pinsky_lab/sequencing/hiseq_2018_09_24_SEQ18/18_APCL_SEQ-for-196-cycles-HLMHLBCX2_2_Read_1_passed_filter.fastq.gz /local/shared/pinsky_lab/sequencing/hiseq_2018_09_24_SEQ18/18_APCL_SEQ-for-196-cycles-HLMHLBCX2_2_Read_2_Index_Read_passed_filter.fastq.gz
Took about 10 hours and there was no output text in nohup.out and no stats.
For large batches, generated the command lines in a script in the seq_proc.Rmd notebook and output the lines into files called SEQXX_cat_all.sh to be copy and pasted here
%%bash
cat ./lane1/P075-read-1.fastq.gz ./lane2/P075-read-1.fastq.gz > ../03Pool/P075.fastq.gz
cat ./lane1/P076-read-1.fastq.gz ./lane2/P076-read-1.fastq.gz > ../04Pool/P076.fastq.gz
cat ./lane1/P073-read-1.fastq.gz ./lane2/P073-read-1.fastq.gz > ../01Pool/P073.fastq.gz
cat ./lane1/P074-read-1.fastq.gz ./lane2/P074-read-1.fastq.gz > ../02Pool/P074.fastq.gz
cat ./lane1/P077-read-1.fastq.gz ./lane2/P077-read-1.fastq.gz > ../05Pool/P077.fastq.gz
cat ./lane1/P078-read-1.fastq.gz ./lane2/P078-read-1.fastq.gz > ../06Pool/P078.fastq.gz
cat ./lane1/P083-read-1.fastq.gz ./lane2/P083-read-1.fastq.gz > ../07Pool/P083.fastq.gz
cat ./lane1/P084-read-1.fastq.gz ./lane2/P084-read-1.fastq.gz > ../08Pool/P084.fastq.gz
cat ./lane1/P085-read-1.fastq.gz ./lane2/P085-read-1.fastq.gz > ../09Pool/P085.fastq.gz
cat ./lane1/P086-read-1.fastq.gz ./lane2/P086-read-1.fastq.gz > ../10Pool/P086.fastq.gz
cat ./lane1/P087-read-1.fastq.gz ./lane2/P087-read-1.fastq.gz > ../11Pool/P087.fastq.gz
cat ./lane1/P088-read-1.fastq.gz ./lane2/P088-read-1.fastq.gz > ../12Pool/P088.fastq.gz
%%bash
nohup ./scripts/P073_process.sh &
nohup ./scripts/P074_process.sh &
nohup ./scripts/P075_process.sh &
nohup ./scripts/P076_process.sh &
nohup ./scripts/P077_process.sh &
nohup ./scripts/P078_process.sh &
nohup ./scripts/P083_process.sh &
nohup ./scripts/P084_process.sh &
nohup ./scripts/P085_process.sh &
nohup ./scripts/P086_process.sh &
nohup ./scripts/P087_process.sh &
nohup ./scripts/P088_process.sh &
%%bash
mv 01Pool/process_radtags.log ./logs/processP075.log
mv 02Pool/process_radtags.log ./logs/processP076.log
mv 03Pool/process_radtags.log ./logs/processP073.log
mv 04Pool/process_radtags.log ./logs/processP074.log
mv 05Pool/process_radtags.log ./logs/processP077.log
mv 06Pool/process_radtags.log ./logs/processP078.log
mv 07Pool/process_radtags.log ./logs/processP083.log
mv 08Pool/process_radtags.log ./logs/processP084.log
mv 09Pool/process_radtags.log ./logs/processP085.log
mv 10Pool/process_radtags.log ./logs/processP086.log
mv 11Pool/process_radtags.log ./logs/processP087.log
mv 12Pool/process_radtags.log ./logs/processP088.log
%%bash
cd ~/02-apcl-ddocent/18seq/logs/
pwd
mv processP075.log processP073.log.b
mv processP073.log processP075.log
mv processP073.log.b processP073.log
mv processP076.log processP074.log.b
mv processP074.log processP076.log
mv processP074.log.b processP074.log
# latlon_3.py - for use in Chapter 10 PCfB
# Read in each line of the example file, split it into
# separate components, and write certain output to a separate file
# Set the input file name
# (The program must be run from within the directory
# that contains this data file)
#InFileName = './logs/16process.out'
InFileName = '/local/home/michelles/02-apcl-ddocent/18seq/logs/processP073.log'
# Open the input file for reading
InFile = open(InFileName, 'r')
# Initialize the counter used to keep track of line numbers
LineNumber = 0
# Open the output file for writing
# Do this *before* the loop, not inside it
OutFileName=InFileName + ".tsv"
OutFile=open(OutFileName,'w') # You can append instead with 'a'
# Loop through each line in the file
for Line in InFile:
# Skip the header, line # 0
if LineNumber < 62:
if LineNumber > 13:
# Remove the line ending characters
Line=Line.strip('\n')
# Separate the line into a list of its tab-delimited components
ElementList=Line.split('\t')
Barcode = ElementList[0]
Total_Reads = ElementList[1]
Lack_RadTag = ElementList[2]
Low_Quality = ElementList[3]
Retained = ElementList[4]
# Use the % operator to generate a string
# We can use this for output both to the screen and to a file
OutputString = "%s\t%s\t%s\t%s\t%s" % (ElementList[0], ElementList[1], ElementList[2], ElementList[3], ElementList[4])
# Can still print to the screen then write to a file
print (OutputString)
# Unlike print statements, .write needs a linefeed
OutFile.write(OutputString+"\n")
# Index the counter used to keep track of line numbers
LineNumber = LineNumber + 1
# After the loop is completed, close the files
InFile.close()
OutFile.close()
%ls 02-apcl-ddocent/18seq/logs
# latlon_3.py - for use in Chapter 10 PCfB
# Read in each line of the example file, split it into
# separate components, and write certain output to a separate file
# Set the input file name
# (The program must be run from within the directory
# that contains this data file)
#InFileName = './logs/16process.out'
InFileName = '/local/home/michelles/02-apcl-ddocent/18seq/logs/processP074.log'
# Open the input file for reading
InFile = open(InFileName, 'r')
# Initialize the counter used to keep track of line numbers
LineNumber = 0
# Open the output file for writing
# Do this *before* the loop, not inside it
OutFileName=InFileName + ".tsv"
OutFile=open(OutFileName,'w') # You can append instead with 'a'
# Loop through each line in the file
for Line in InFile:
# Skip the header, line # 0
if LineNumber < 62:
if LineNumber > 13:
# Remove the line ending characters
Line=Line.strip('\n')
# Separate the line into a list of its tab-delimited components
ElementList=Line.split('\t')
Barcode = ElementList[0]
Total_Reads = ElementList[1]
Lack_RadTag = ElementList[2]
Low_Quality = ElementList[3]
Retained = ElementList[4]
# Use the % operator to generate a string
# We can use this for output both to the screen and to a file
OutputString = "%s\t%s\t%s\t%s\t%s" % (ElementList[0], ElementList[1], ElementList[2], ElementList[3], ElementList[4])
# Can still print to the screen then write to a file
print (OutputString)
# Unlike print statements, .write needs a linefeed
OutFile.write(OutputString+"\n")
# Index the counter used to keep track of line numbers
LineNumber = LineNumber + 1
# After the loop is completed, close the files
InFile.close()
OutFile.close()
# latlon_3.py - for use in Chapter 10 PCfB
# Read in each line of the example file, split it into
# separate components, and write certain output to a separate file
# Set the input file name
# (The program must be run from within the directory
# that contains this data file)
#InFileName = './logs/16process.out'
InFileName = '/local/home/michelles/02-apcl-ddocent/18seq/logs/processP075.log'
# Open the input file for reading
InFile = open(InFileName, 'r')
# Initialize the counter used to keep track of line numbers
LineNumber = 0
# Open the output file for writing
# Do this *before* the loop, not inside it
OutFileName=InFileName + ".tsv"
OutFile=open(OutFileName,'w') # You can append instead with 'a'
# Loop through each line in the file
for Line in InFile:
# Skip the header, line # 0
if LineNumber < 62:
if LineNumber > 13:
# Remove the line ending characters
Line=Line.strip('\n')
# Separate the line into a list of its tab-delimited components
ElementList=Line.split('\t')
Barcode = ElementList[0]
Total_Reads = ElementList[1]
Lack_RadTag = ElementList[2]
Low_Quality = ElementList[3]
Retained = ElementList[4]
# Use the % operator to generate a string
# We can use this for output both to the screen and to a file
OutputString = "%s\t%s\t%s\t%s\t%s" % (ElementList[0], ElementList[1], ElementList[2], ElementList[3], ElementList[4])
# Can still print to the screen then write to a file
print (OutputString)
# Unlike print statements, .write needs a linefeed
OutFile.write(OutputString+"\n")
# Index the counter used to keep track of line numbers
LineNumber = LineNumber + 1
# After the loop is completed, close the files
InFile.close()
OutFile.close()
# latlon_3.py - for use in Chapter 10 PCfB
# Read in each line of the example file, split it into
# separate components, and write certain output to a separate file
# Set the input file name
# (The program must be run from within the directory
# that contains this data file)
#InFileName = './logs/16process.out'
InFileName = '/local/home/michelles/02-apcl-ddocent/18seq/logs/processP076.log'
# Open the input file for reading
InFile = open(InFileName, 'r')
# Initialize the counter used to keep track of line numbers
LineNumber = 0
# Open the output file for writing
# Do this *before* the loop, not inside it
OutFileName=InFileName + ".tsv"
OutFile=open(OutFileName,'w') # You can append instead with 'a'
# Loop through each line in the file
for Line in InFile:
# Skip the header, line # 0
if LineNumber < 62:
if LineNumber > 13:
# Remove the line ending characters
Line=Line.strip('\n')
# Separate the line into a list of its tab-delimited components
ElementList=Line.split('\t')
Barcode = ElementList[0]
Total_Reads = ElementList[1]
Lack_RadTag = ElementList[2]
Low_Quality = ElementList[3]
Retained = ElementList[4]
# Use the % operator to generate a string
# We can use this for output both to the screen and to a file
OutputString = "%s\t%s\t%s\t%s\t%s" % (ElementList[0], ElementList[1], ElementList[2], ElementList[3], ElementList[4])
# Can still print to the screen then write to a file
print (OutputString)
# Unlike print statements, .write needs a linefeed
OutFile.write(OutputString+"\n")
# Index the counter used to keep track of line numbers
LineNumber = LineNumber + 1
# After the loop is completed, close the files
InFile.close()
OutFile.close()
# latlon_3.py - for use in Chapter 10 PCfB
# Read in each line of the example file, split it into
# separate components, and write certain output to a separate file
# Set the input file name
# (The program must be run from within the directory
# that contains this data file)
#InFileName = './logs/16process.out'
InFileName = '/local/home/michelles/02-apcl-ddocent/18seq/logs/processP077.log'
# Open the input file for reading
InFile = open(InFileName, 'r')
# Initialize the counter used to keep track of line numbers
LineNumber = 0
# Open the output file for writing
# Do this *before* the loop, not inside it
OutFileName=InFileName + ".tsv"
OutFile=open(OutFileName,'w') # You can append instead with 'a'
# Loop through each line in the file
for Line in InFile:
# Skip the header, line # 0
if LineNumber < 62:
if LineNumber > 13:
# Remove the line ending characters
Line=Line.strip('\n')
# Separate the line into a list of its tab-delimited components
ElementList=Line.split('\t')
Barcode = ElementList[0]
Total_Reads = ElementList[1]
Lack_RadTag = ElementList[2]
Low_Quality = ElementList[3]
Retained = ElementList[4]
# Use the % operator to generate a string
# We can use this for output both to the screen and to a file
OutputString = "%s\t%s\t%s\t%s\t%s" % (ElementList[0], ElementList[1], ElementList[2], ElementList[3], ElementList[4])
# Can still print to the screen then write to a file
print (OutputString)
# Unlike print statements, .write needs a linefeed
OutFile.write(OutputString+"\n")
# Index the counter used to keep track of line numbers
LineNumber = LineNumber + 1
# After the loop is completed, close the files
InFile.close()
OutFile.close()
# latlon_3.py - for use in Chapter 10 PCfB
# Read in each line of the example file, split it into
# separate components, and write certain output to a separate file
# Set the input file name
# (The program must be run from within the directory
# that contains this data file)
#InFileName = './logs/16process.out'
InFileName = '/local/home/michelles/02-apcl-ddocent/18seq/logs/processP078.log'
# Open the input file for reading
InFile = open(InFileName, 'r')
# Initialize the counter used to keep track of line numbers
LineNumber = 0
# Open the output file for writing
# Do this *before* the loop, not inside it
OutFileName=InFileName + ".tsv"
OutFile=open(OutFileName,'w') # You can append instead with 'a'
# Loop through each line in the file
for Line in InFile:
# Skip the header, line # 0
if LineNumber < 62:
if LineNumber > 13:
# Remove the line ending characters
Line=Line.strip('\n')
# Separate the line into a list of its tab-delimited components
ElementList=Line.split('\t')
Barcode = ElementList[0]
Total_Reads = ElementList[1]
Lack_RadTag = ElementList[2]
Low_Quality = ElementList[3]
Retained = ElementList[4]
# Use the % operator to generate a string
# We can use this for output both to the screen and to a file
OutputString = "%s\t%s\t%s\t%s\t%s" % (ElementList[0], ElementList[1], ElementList[2], ElementList[3], ElementList[4])
# Can still print to the screen then write to a file
print (OutputString)
# Unlike print statements, .write needs a linefeed
OutFile.write(OutputString+"\n")
# Index the counter used to keep track of line numbers
LineNumber = LineNumber + 1
# After the loop is completed, close the files
InFile.close()
OutFile.close()
%ls 02-apcl-ddocent/18seq/logs
# latlon_3.py - for use in Chapter 10 PCfB
# Read in each line of the example file, split it into
# separate components, and write certain output to a separate file
# Set the input file name
# (The program must be run from within the directory
# that contains this data file)
#InFileName = './logs/16process.out'
InFileName = '/local/home/michelles/02-apcl-ddocent/18seq/logs/processP083.log'
# Open the input file for reading
InFile = open(InFileName, 'r')
# Initialize the counter used to keep track of line numbers
LineNumber = 0
# Open the output file for writing
# Do this *before* the loop, not inside it
OutFileName=InFileName + ".tsv"
OutFile=open(OutFileName,'w') # You can append instead with 'a'
# Loop through each line in the file
for Line in InFile:
# Skip the header, line # 0
if LineNumber < 62:
if LineNumber > 13:
# Remove the line ending characters
Line=Line.strip('\n')
# Separate the line into a list of its tab-delimited components
ElementList=Line.split('\t')
Barcode = ElementList[0]
Total_Reads = ElementList[1]
Lack_RadTag = ElementList[2]
Low_Quality = ElementList[3]
Retained = ElementList[4]
# Use the % operator to generate a string
# We can use this for output both to the screen and to a file
OutputString = "%s\t%s\t%s\t%s\t%s" % (ElementList[0], ElementList[1], ElementList[2], ElementList[3], ElementList[4])
# Can still print to the screen then write to a file
print (OutputString)
# Unlike print statements, .write needs a linefeed
OutFile.write(OutputString+"\n")
# Index the counter used to keep track of line numbers
LineNumber = LineNumber + 1
# After the loop is completed, close the files
InFile.close()
OutFile.close()
# latlon_3.py - for use in Chapter 10 PCfB
# Read in each line of the example file, split it into
# separate components, and write certain output to a separate file
# Set the input file name
# (The program must be run from within the directory
# that contains this data file)
#InFileName = './logs/16process.out'
InFileName = '/local/home/michelles/02-apcl-ddocent/18seq/logs/processP084.log'
# Open the input file for reading
InFile = open(InFileName, 'r')
# Initialize the counter used to keep track of line numbers
LineNumber = 0
# Open the output file for writing
# Do this *before* the loop, not inside it
OutFileName=InFileName + ".tsv"
OutFile=open(OutFileName,'w') # You can append instead with 'a'
# Loop through each line in the file
for Line in InFile:
# Skip the header, line # 0
if LineNumber < 62:
if LineNumber > 13:
# Remove the line ending characters
Line=Line.strip('\n')
# Separate the line into a list of its tab-delimited components
ElementList=Line.split('\t')
Barcode = ElementList[0]
Total_Reads = ElementList[1]
Lack_RadTag = ElementList[2]
Low_Quality = ElementList[3]
Retained = ElementList[4]
# Use the % operator to generate a string
# We can use this for output both to the screen and to a file
OutputString = "%s\t%s\t%s\t%s\t%s" % (ElementList[0], ElementList[1], ElementList[2], ElementList[3], ElementList[4])
# Can still print to the screen then write to a file
print (OutputString)
# Unlike print statements, .write needs a linefeed
OutFile.write(OutputString+"\n")
# Index the counter used to keep track of line numbers
LineNumber = LineNumber + 1
# After the loop is completed, close the files
InFile.close()
OutFile.close()
# latlon_3.py - for use in Chapter 10 PCfB
# Read in each line of the example file, split it into
# separate components, and write certain output to a separate file
# Set the input file name
# (The program must be run from within the directory
# that contains this data file)
#InFileName = './logs/16process.out'
InFileName = '/local/home/michelles/02-apcl-ddocent/18seq/logs/processP085.log'
# Open the input file for reading
InFile = open(InFileName, 'r')
# Initialize the counter used to keep track of line numbers
LineNumber = 0
# Open the output file for writing
# Do this *before* the loop, not inside it
OutFileName=InFileName + ".tsv"
OutFile=open(OutFileName,'w') # You can append instead with 'a'
# Loop through each line in the file
for Line in InFile:
# Skip the header, line # 0
if LineNumber < 62:
if LineNumber > 13:
# Remove the line ending characters
Line=Line.strip('\n')
# Separate the line into a list of its tab-delimited components
ElementList=Line.split('\t')
Barcode = ElementList[0]
Total_Reads = ElementList[1]
Lack_RadTag = ElementList[2]
Low_Quality = ElementList[3]
Retained = ElementList[4]
# Use the % operator to generate a string
# We can use this for output both to the screen and to a file
OutputString = "%s\t%s\t%s\t%s\t%s" % (ElementList[0], ElementList[1], ElementList[2], ElementList[3], ElementList[4])
# Can still print to the screen then write to a file
print (OutputString)
# Unlike print statements, .write needs a linefeed
OutFile.write(OutputString+"\n")
# Index the counter used to keep track of line numbers
LineNumber = LineNumber + 1
# After the loop is completed, close the files
InFile.close()
OutFile.close()
# latlon_3.py - for use in Chapter 10 PCfB
# Read in each line of the example file, split it into
# separate components, and write certain output to a separate file
# Set the input file name
# (The program must be run from within the directory
# that contains this data file)
#InFileName = './logs/16process.out'
InFileName = '/local/home/michelles/02-apcl-ddocent/18seq/logs/processP086.log'
# Open the input file for reading
InFile = open(InFileName, 'r')
# Initialize the counter used to keep track of line numbers
LineNumber = 0
# Open the output file for writing
# Do this *before* the loop, not inside it
OutFileName=InFileName + ".tsv"
OutFile=open(OutFileName,'w') # You can append instead with 'a'
# Loop through each line in the file
for Line in InFile:
# Skip the header, line # 0
if LineNumber < 62:
if LineNumber > 13:
# Remove the line ending characters
Line=Line.strip('\n')
# Separate the line into a list of its tab-delimited components
ElementList=Line.split('\t')
Barcode = ElementList[0]
Total_Reads = ElementList[1]
Lack_RadTag = ElementList[2]
Low_Quality = ElementList[3]
Retained = ElementList[4]
# Use the % operator to generate a string
# We can use this for output both to the screen and to a file
OutputString = "%s\t%s\t%s\t%s\t%s" % (ElementList[0], ElementList[1], ElementList[2], ElementList[3], ElementList[4])
# Can still print to the screen then write to a file
print (OutputString)
# Unlike print statements, .write needs a linefeed
OutFile.write(OutputString+"\n")
# Index the counter used to keep track of line numbers
LineNumber = LineNumber + 1
# After the loop is completed, close the files
InFile.close()
OutFile.close()
# latlon_3.py - for use in Chapter 10 PCfB
# Read in each line of the example file, split it into
# separate components, and write certain output to a separate file
# Set the input file name
# (The program must be run from within the directory
# that contains this data file)
#InFileName = './logs/16process.out'
InFileName = '/local/home/michelles/02-apcl-ddocent/18seq/logs/processP087.log'
# Open the input file for reading
InFile = open(InFileName, 'r')
# Initialize the counter used to keep track of line numbers
LineNumber = 0
# Open the output file for writing
# Do this *before* the loop, not inside it
OutFileName=InFileName + ".tsv"
OutFile=open(OutFileName,'w') # You can append instead with 'a'
# Loop through each line in the file
for Line in InFile:
# Skip the header, line # 0
if LineNumber < 62:
if LineNumber > 13:
# Remove the line ending characters
Line=Line.strip('\n')
# Separate the line into a list of its tab-delimited components
ElementList=Line.split('\t')
Barcode = ElementList[0]
Total_Reads = ElementList[1]
Lack_RadTag = ElementList[2]
Low_Quality = ElementList[3]
Retained = ElementList[4]
# Use the % operator to generate a string
# We can use this for output both to the screen and to a file
OutputString = "%s\t%s\t%s\t%s\t%s" % (ElementList[0], ElementList[1], ElementList[2], ElementList[3], ElementList[4])
# Can still print to the screen then write to a file
print (OutputString)
# Unlike print statements, .write needs a linefeed
OutFile.write(OutputString+"\n")
# Index the counter used to keep track of line numbers
LineNumber = LineNumber + 1
# After the loop is completed, close the files
InFile.close()
OutFile.close()
# latlon_3.py - for use in Chapter 10 PCfB
# Read in each line of the example file, split it into
# separate components, and write certain output to a separate file
# Set the input file name
# (The program must be run from within the directory
# that contains this data file)
#InFileName = './logs/16process.out'
InFileName = '/local/home/michelles/02-apcl-ddocent/18seq/logs/processP088.log'
# Open the input file for reading
InFile = open(InFileName, 'r')
# Initialize the counter used to keep track of line numbers
LineNumber = 0
# Open the output file for writing
# Do this *before* the loop, not inside it
OutFileName=InFileName + ".tsv"
OutFile=open(OutFileName,'w') # You can append instead with 'a'
# Loop through each line in the file
for Line in InFile:
# Skip the header, line # 0
if LineNumber < 62:
if LineNumber > 13:
# Remove the line ending characters
Line=Line.strip('\n')
# Separate the line into a list of its tab-delimited components
ElementList=Line.split('\t')
Barcode = ElementList[0]
Total_Reads = ElementList[1]
Lack_RadTag = ElementList[2]
Low_Quality = ElementList[3]
Retained = ElementList[4]
# Use the % operator to generate a string
# We can use this for output both to the screen and to a file
OutputString = "%s\t%s\t%s\t%s\t%s" % (ElementList[0], ElementList[1], ElementList[2], ElementList[3], ElementList[4])
# Can still print to the screen then write to a file
print (OutputString)
# Unlike print statements, .write needs a linefeed
OutFile.write(OutputString+"\n")
# Index the counter used to keep track of line numbers
LineNumber = LineNumber + 1
# After the loop is completed, close the files
InFile.close()
OutFile.close()
%%bash
cd /local/home/michelles/02-apcl-ddocent/18seq/
cd 01Pool/
sh rename.for.dDocent_se_gz ../logs/names_073.tsv
mv APCL* ../samples/
cd ../02Pool/
sh rename.for.dDocent_se_gz ../logs/names_074.tsv
mv APCL* ../samples/
cd ../03Pool/
sh rename.for.dDocent_se_gz ../logs/names_075.tsv
mv APCL* ../samples/
cd ../04Pool/
sh rename.for.dDocent_se_gz ../logs/names_076.tsv
mv APCL* ../samples/
cd ../05Pool/
sh rename.for.dDocent_se_gz ../logs/names_077.tsv
mv APCL* ../samples/
cd ../06Pool/
sh rename.for.dDocent_se_gz ../logs/names_078.tsv
mv APCL* ../samples/
cd ../07Pool/
sh rename.for.dDocent_se_gz ../logs/names_083.tsv
mv APCL* ../samples/
cd ../08Pool/
sh rename.for.dDocent_se_gz ../logs/names_084.tsv
mv APCL* ../samples/
cd ../09Pool/
sh rename.for.dDocent_se_gz ../logs/names_085.tsv
mv APCL* ../samples/
cd ../10Pool/
sh rename.for.dDocent_se_gz ../logs/names_086.tsv
mv APCL* ../samples/
cd ../11Pool/
sh rename.for.dDocent_se_gz ../logs/names_087.tsv
mv APCL* ../samples/
cd ../12Pool/
sh rename.for.dDocent_se_gz ../logs/names_088.tsv
mv APCL* ../samples/
cd ..
%rm -r *Pool
%mkdir ~/02-apcl-ddocent/APCL_analysis/21-03seq
% cp /local/home/michelles/02-apcl-ddocent/jonsfiles/reference.fasta /local/home/michelles/02-apcl-ddocent/APCL_analysis/test_28_03_seq/
for this phase, dDocent will ask questions.
dDocent