The "string goes to the beginning of the line" is symptomatic of a carriage return in your $line
that you can among many other ways remove with a tr
pipe to your file:
while IFS= read -r line
do
echo "line ${line}"
pdbfile=${line}.pdb
echo "pdbfile ${pdbfile}"
done < <(tr -d '\r'